Documentation ¶
Index ¶
- func AddCaches(cacheFiles ...string)
- func AddEngine(e Engine)
- func AddEngineHighestPriority(e Engine) error
- func AddRightAlignedString(original, addition string) string
- func FetchAnswer(prob qatypes.Problem) (qatypes.Problem, error)
- func FetchBoolAnswer(probid, desc string, context []string, def bool, ...) bool
- func FetchMultiSelectAnswer(probid, desc string, context, def, options []string, ...) []string
- func FetchMultilineInputAnswer(probid, desc string, context []string, def string, ...) string
- func FetchPasswordAnswer(probid, desc string, context []string, validator func(interface{}) error) string
- func FetchSelectAnswer(probid, desc string, context []string, def string, options []string, ...) string
- func FetchStringAnswer(probid, desc string, context []string, def string, ...) string
- func SetupConfigFile(writeConfigFile string, configStrings, configFiles, presets []string, ...)
- func SetupWriteCacheFile(writeCachePath string, persistPasswords bool)
- func StartEngine(qaskip bool, qaport int, qadisablecli bool)
- func ValidateProblem(prob qatypes.Problem) error
- func WriteStoresToDisk() error
- type CliEngine
- type DefaultEngine
- type Engine
- type HTTPRESTEngine
- type StoreEngine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCaches ¶
func AddCaches(cacheFiles ...string)
AddCaches adds cache responders. Later cache files override earlier cache files. [base.yaml, project.yaml, service.yaml]
func AddEngineHighestPriority ¶
AddEngineHighestPriority adds an engine to the list and sets it at highest priority
func AddRightAlignedString ¶ added in v0.3.12
AddRightAlignedString adds a new string to the right of the original, with max width the size of the current terminal window
func FetchAnswer ¶
FetchAnswer fetches the answer for the question
func FetchBoolAnswer ¶
func FetchBoolAnswer(probid, desc string, context []string, def bool, validator func(interface{}) error) bool
FetchBoolAnswer asks a confirm type question and gets a boolean as the answer
func FetchMultiSelectAnswer ¶
func FetchMultiSelectAnswer(probid, desc string, context, def, options []string, validator func(interface{}) error) []string
FetchMultiSelectAnswer asks a multi-select type question and gets a slice of strings as the answer
func FetchMultilineInputAnswer ¶
func FetchMultilineInputAnswer(probid, desc string, context []string, def string, validator func(interface{}) error) string
FetchMultilineInputAnswer asks a multi-line type question and gets a string as the answer
func FetchPasswordAnswer ¶
func FetchPasswordAnswer(probid, desc string, context []string, validator func(interface{}) error) string
FetchPasswordAnswer asks a password type question and gets a string as the answer
func FetchSelectAnswer ¶
func FetchSelectAnswer(probid, desc string, context []string, def string, options []string, validator func(interface{}) error) string
FetchSelectAnswer asks a select type question and gets a string as the answer
func FetchStringAnswer ¶
func FetchStringAnswer(probid, desc string, context []string, def string, validator func(interface{}) error) string
FetchStringAnswer asks a input type question and gets a string as the answer
func SetupConfigFile ¶
func SetupConfigFile(writeConfigFile string, configStrings, configFiles, presets []string, persistPasswords bool)
SetupConfigFile adds config responders - should be called only once
func SetupWriteCacheFile ¶
SetupWriteCacheFile adds write cache
func StartEngine ¶
StartEngine starts the QA Engines
func ValidateProblem ¶
ValidateProblem validates the problem object.
func WriteStoresToDisk ¶
func WriteStoresToDisk() error
WriteStoresToDisk forces all the stores to write their contents out to disk
Types ¶
type CliEngine ¶
type CliEngine struct { }
CliEngine handles the CLI based qa
func (*CliEngine) FetchAnswer ¶
FetchAnswer fetches the answer using cli
func (*CliEngine) IsInteractiveEngine ¶
IsInteractiveEngine returns true if the engine interacts with the user
func (*CliEngine) StartEngine ¶
StartEngine starts the cli engine
type DefaultEngine ¶
type DefaultEngine struct { }
DefaultEngine returns default values for all questions
func NewDefaultEngine ¶
func NewDefaultEngine() *DefaultEngine
NewDefaultEngine creates a new instance of default engine
func (*DefaultEngine) FetchAnswer ¶
FetchAnswer fetches the default answers
func (*DefaultEngine) IsInteractiveEngine ¶
func (*DefaultEngine) IsInteractiveEngine() bool
IsInteractiveEngine returns true if the engine interacts with the user
func (*DefaultEngine) StartEngine ¶
func (*DefaultEngine) StartEngine() error
StartEngine starts the default qa engine
type Engine ¶
type Engine interface { StartEngine() error IsInteractiveEngine() bool FetchAnswer(prob qatypes.Problem) (ans qatypes.Problem, err error) }
Engine defines interface for qa engines
func NewHTTPRESTEngine ¶
NewHTTPRESTEngine creates a new instance of Http REST engine
type HTTPRESTEngine ¶
type HTTPRESTEngine struct {
// contains filtered or unexported fields
}
HTTPRESTEngine handles qa using HTTP REST services
func (*HTTPRESTEngine) FetchAnswer ¶
FetchAnswer fetches the answer using a REST service
func (*HTTPRESTEngine) IsInteractiveEngine ¶
func (*HTTPRESTEngine) IsInteractiveEngine() bool
IsInteractiveEngine returns true if the engine interacts with the user
func (*HTTPRESTEngine) StartEngine ¶
func (h *HTTPRESTEngine) StartEngine() error
StartEngine starts the QA Engine
type StoreEngine ¶
type StoreEngine struct {
// contains filtered or unexported fields
}
StoreEngine handles cache
func NewStoreEngineFromCache ¶
func NewStoreEngineFromCache(cacheFile string, persistPasswords bool) *StoreEngine
NewStoreEngineFromCache creates a new cache instance
func (*StoreEngine) FetchAnswer ¶
FetchAnswer fetches the answer from the store
func (*StoreEngine) IsInteractiveEngine ¶
func (*StoreEngine) IsInteractiveEngine() bool
IsInteractiveEngine returns true if the engine interacts with the user
func (*StoreEngine) StartEngine ¶
func (se *StoreEngine) StartEngine() error
StartEngine loads the config from the store