Documentation
¶
Index ¶
- func MapVerbosity(verbosity string) int
- func UnMapVerbosity(verbosity int) string
- type Action
- type ActionSettings
- type AppSettings
- type Condition
- type ConfigFactory
- type Configuration
- func (c *Configuration) AnsiColors() bool
- func (c *Configuration) CustomSettings() map[string]string
- func (c *Configuration) FailOnFirstError() bool
- func (c *Configuration) GitDirectory() string
- func (c *Configuration) HookConfig(hook string) *Hook
- func (c *Configuration) Includes() []string
- func (c *Configuration) IsFailureAllowed() bool
- func (c *Configuration) IsHookEnabled(hook string) bool
- func (c *Configuration) IsLoadedFromFile() bool
- func (c *Configuration) MaxIncludeLevel() int
- func (c *Configuration) Path() string
- func (c *Configuration) RunAsync() bool
- func (c *Configuration) RunPath() string
- func (c *Configuration) Verbosity() int
- type Hook
- type JsonAction
- type JsonActionSettings
- type JsonAppSettings
- type JsonCondition
- type JsonConfiguration
- type JsonFactory
- type JsonHook
- type NullableAppSettings
- type Options
- type YamlAction
- type YamlActionSettings
- type YamlAppSettings
- type YamlCondition
- type YamlConfiguration
- type YamlFactory
- type YamlHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapVerbosity ¶
func UnMapVerbosity ¶
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
func (*Action) Conditions ¶
func (*Action) IsFailureAllowed ¶
func (*Action) WorkingDir ¶
type ActionSettings ¶
func NewDefaultActionSettings ¶
func NewDefaultActionSettings() *ActionSettings
type AppSettings ¶
type AppSettings struct {
AllowFailure bool
AnsiColors bool
Custom map[string]string
FailOnFirstError bool
GitDirectory string
Includes []string
IncludeLevel int
RunPath string
RunAsync bool
Verbosity string
}
func NewDefaultAppSettings ¶
func NewDefaultAppSettings() *AppSettings
type Condition ¶
type Condition struct {
// contains filtered or unexported fields
}
func (*Condition) Conditions ¶
type ConfigFactory ¶
type ConfigFactory interface {
// CreateConfig creates a CaptainHook configuration
CreateConfig(path string, cliSettings *NullableAppSettings) (*Configuration, error)
}
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
func NewConfiguration ¶
func NewConfiguration(path string, fileExists bool) *Configuration
func (*Configuration) AnsiColors ¶
func (c *Configuration) AnsiColors() bool
func (*Configuration) CustomSettings ¶
func (c *Configuration) CustomSettings() map[string]string
func (*Configuration) FailOnFirstError ¶
func (c *Configuration) FailOnFirstError() bool
func (*Configuration) GitDirectory ¶
func (c *Configuration) GitDirectory() string
func (*Configuration) HookConfig ¶
func (c *Configuration) HookConfig(hook string) *Hook
func (*Configuration) Includes ¶
func (c *Configuration) Includes() []string
func (*Configuration) IsFailureAllowed ¶
func (c *Configuration) IsFailureAllowed() bool
func (*Configuration) IsHookEnabled ¶
func (c *Configuration) IsHookEnabled(hook string) bool
func (*Configuration) IsLoadedFromFile ¶
func (c *Configuration) IsLoadedFromFile() bool
func (*Configuration) MaxIncludeLevel ¶
func (c *Configuration) MaxIncludeLevel() int
func (*Configuration) Path ¶
func (c *Configuration) Path() string
func (*Configuration) RunAsync ¶
func (c *Configuration) RunAsync() bool
func (*Configuration) RunPath ¶
func (c *Configuration) RunPath() string
func (*Configuration) Verbosity ¶
func (c *Configuration) Verbosity() int
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
func (*Hook) GetActions ¶
type JsonAction ¶
type JsonAction struct {
Run string `json:"run,omitempty"`
Conditions []*JsonCondition `json:"conditions,omitempty"`
Options *map[string]interface{} `json:"options,omitempty"`
Settings *JsonActionSettings `json:"config,omitempty"`
}
type JsonActionSettings ¶
type JsonAppSettings ¶
type JsonAppSettings struct {
AllowFailure *bool `json:"allow-failure,omitempty"`
AnsiColors *bool `json:"ansi-colors,omitempty"`
Custom *map[string]string `json:"custom,omitempty"`
FailOnFirstError *bool `json:"fail-on-first-error,omitempty"`
GitDirectory *string `json:"git-directory,omitempty"`
Includes *[]string `json:"includes,omitempty"`
IncludeLevel *int `json:"includes-level,omitempty"`
RunPath *string `json:"run-path,omitempty"`
RunAsync *bool `json:"run-async,omitempty"`
Verbosity *string `json:"verbosity,omitempty"`
}
type JsonCondition ¶
type JsonCondition struct {
Run string `json:"run,omitempty"`
Options *map[string]interface{} `json:"options,omitempty"`
Conditions []*JsonCondition `json:"conditions,omitempty"`
}
type JsonConfiguration ¶
type JsonConfiguration struct {
Settings *JsonAppSettings `json:"config,omitempty"`
Hooks *map[string]*JsonHook `json:"hooks,omitempty"`
}
type JsonFactory ¶
type JsonFactory struct {
// contains filtered or unexported fields
}
func NewJsonFactory ¶
func NewJsonFactory() *JsonFactory
func (*JsonFactory) CreateConfig ¶
func (f *JsonFactory) CreateConfig(path string, cliSettings *NullableAppSettings) (*Configuration, error)
CreateConfig creates a default configuration in case the file exists it is loaded
type JsonHook ¶
type JsonHook struct {
Actions []*JsonAction `json:"actions"`
}
type NullableAppSettings ¶
type NullableAppSettings struct {
AllowFailure *bool
AnsiColors *bool
Custom *map[string]string
FailOnFirstError *bool
GitDirectory *string
Includes *[]string
IncludeLevel *int
RunPath *string
RunAsync *bool
Verbosity *string
}
NullableAppSettings represents the command argument and options that can be provided or can be skipped
func NewNullableAppSettings ¶
func NewNullableAppSettings() *NullableAppSettings
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func NewOptions ¶
func (Options) AsSliceOfStrings ¶
AsSliceOfStrings tries to convert an option value to a slice of strings and return it
type YamlAction ¶
type YamlAction struct {
Run string `yaml:"run"`
Options *map[string]interface{} `yaml:"options,omitempty"`
Settings *YamlActionSettings `yaml:"config,omitempty"`
Conditions []YamlCondition `yaml:"conditions,omitempty"`
}
type YamlActionSettings ¶
type YamlAppSettings ¶
type YamlAppSettings struct {
AllowFailure *bool `yaml:"allow-failure,omitempty"`
AnsiColors *bool `yaml:"ansi-colors,omitempty"`
Custom *map[string]string `yaml:"custom,omitempty"`
FailOnFirstError *bool `yaml:"fail-on-first-error,omitempty"`
GitDirectory *string `yaml:"git-directory,omitempty"`
Includes *[]string `yaml:"includes,omitempty"`
IncludeLevel *int `yaml:"includes-level,omitempty"`
RunAsync *bool `yaml:"run-async,omitempty"`
RunPath *string `yaml:"run-path,omitempty"`
Verbosity *string `yaml:"verbosity,omitempty"`
}
type YamlCondition ¶
type YamlCondition struct {
Run string `yaml:"run"`
Options *map[string]interface{} `yaml:"options,omitempty"`
Conditions []YamlCondition `yaml:"conditions,omitempty"`
}
type YamlConfiguration ¶
type YamlConfiguration struct {
Settings *YamlAppSettings `yaml:"config,omitempty"`
Hooks *map[string]YamlHook `yaml:"hooks"`
}
type YamlFactory ¶
type YamlFactory struct {
// contains filtered or unexported fields
}
func NewYamlFactory ¶
func NewYamlFactory() *YamlFactory
func (*YamlFactory) CreateConfig ¶
func (f *YamlFactory) CreateConfig(path string, cliSettings *NullableAppSettings) (*Configuration, error)
CreateConfig creates a default configuration in case the file exists it is loaded
type YamlHook ¶
type YamlHook struct {
Actions []YamlAction `yaml:"actions"`
}
Click to show internal directories.
Click to hide internal directories.