package load

import "github.com/oslokommune/okctl/pkg/config/load"

Package load knows how to load application and repository data

Index

Functions

func PromptContinue

func PromptContinue(msg, errMsg string) error

PromptContinue asks the user a question and does not abort if a positive response is provided

func UserDataFromFlagsEnvConfigDefaults

func UserDataFromFlagsEnvConfigDefaults(cmd *cobra.Command, notFoundFn DataNotFoundFn) config.DataLoaderFn

UserDataFromFlagsEnvConfigDefaults returns the default behavior for loading application state

Types

type DataNotFoundErr

type DataNotFoundErr struct {
	// contains filtered or unexported fields
}

DataNotFoundErr stores error returned when data is not found at location

func (*DataNotFoundErr) Error

func (e *DataNotFoundErr) Error() string

Error returns the stored error

type DataNotFoundFn

type DataNotFoundFn func(*config.Config) error

DataNotFoundFn determines what should be done if data is not found

func CreateOnUserDataNotFound

func CreateOnUserDataNotFound() DataNotFoundFn

CreateOnUserDataNotFound will start an interactive survey that allows the end user to configure okctl for their use

func CreateOnUserDataNotFoundWithNoInput

func CreateOnUserDataNotFoundWithNoInput() DataNotFoundFn

CreateOnUserDataNotFoundWithNoInput initializes a user without user input

func ErrOnUserDataNotFound

func ErrOnUserDataNotFound() DataNotFoundFn

ErrOnUserDataNotFound returns a handler that errors when the app configuration cannot be loaded

type LoaderFn

type LoaderFn func(cfg *config.Config, v *viper.Viper) error

LoaderFn defines an interface for loading configuration

Source Files

load.go user.go

Version
v0.0.106 (latest)
Published
Oct 21, 2022
Platform
linux/amd64
Imports
15 packages
Last checked
5 days ago

Tools for package owners.