Documentation ¶
Index ¶
- func AddCaches(cacheFiles []string)
- func AddEngine(e Engine)
- func AddEngineHighestPriority(e Engine) error
- 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 FetchMultilineAnswer(probid, desc string, context []string, def string) string
- func FetchPasswordAnswer(probid, desc string, context []string) string
- func FetchSelectAnswer(probid, desc string, context []string, def string, options []string) string
- func FetchStringAnswer(probid, desc string, context []string, def string) string
- func SetupCacheFile(outputPath string, cacheFiles []string)
- func SetupConfigFile(outputPath string, configStrings, configFiles, presets []string)
- 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 ¶ added in v0.2.0
AddEngineHighestPriority adds an engine to the list and sets it at highest priority
func FetchAnswer ¶
FetchAnswer fetches the answer for the question
func FetchBoolAnswer ¶ added in v0.2.0
FetchBoolAnswer asks a confirm type question and gets a boolean as the answer
func FetchMultiSelectAnswer ¶ added in v0.2.0
FetchMultiSelectAnswer asks a multi-select type question and gets a slice of strings as the answer
func FetchMultilineAnswer ¶ added in v0.2.0
FetchMultilineAnswer asks a multi-line type question and gets a string as the answer
func FetchPasswordAnswer ¶ added in v0.2.0
FetchPasswordAnswer asks a password type question and gets a string as the answer
func FetchSelectAnswer ¶ added in v0.2.0
FetchSelectAnswer asks a select type question and gets a string as the answer
func FetchStringAnswer ¶ added in v0.2.0
FetchStringAnswer asks a input type question and gets a string as the answer
func SetupCacheFile ¶ added in v0.2.0
SetupCacheFile adds cache responders
func SetupConfigFile ¶ added in v0.2.0
SetupConfigFile adds config responders - should be called only once
func StartEngine ¶
StartEngine starts the QA Engines
func ValidateProblem ¶ added in v0.2.0
ValidateProblem validates the problem object.
func WriteStoresToDisk ¶ added in v0.2.0
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
type StoreEngine struct {
// contains filtered or unexported fields
}
StoreEngine handles cache
func NewStoreEngineFromCache ¶ added in v0.2.0
func NewStoreEngineFromCache(cacheFile string) *StoreEngine
NewStoreEngineFromCache creates a new cache instance
func (*StoreEngine) FetchAnswer ¶ added in v0.2.0
FetchAnswer fetches the answer from the store
func (*StoreEngine) IsInteractiveEngine ¶ added in v0.2.0
func (*StoreEngine) IsInteractiveEngine() bool
IsInteractiveEngine returns true if the engine interacts with the user
func (*StoreEngine) StartEngine ¶ added in v0.2.0
func (se *StoreEngine) StartEngine() error
StartEngine loads the config from the store