Documentation ¶
Index ¶
- Constants
- func IsValueInList(value string, list []string) bool
- func ValidateSections(unmarshal func(any) error, i any, whitelist map[string]bool) error
- func WhitelistAttrs(i any, format format) (map[string]bool, error)
- type Command
- type Config
- type ConfigOption
- func WithCache(d time.Duration) ConfigOption
- func WithColor() ConfigOption
- func WithDebug() ConfigOption
- func WithDisabledResourceTypes(t ...string) ConfigOption
- func WithFormatOptions(opts ...string) ConfigOption
- func WithMaxConcurrency(mc int) ConfigOption
- func WithNoColor() ConfigOption
- func WithOutputFormat(f string) ConfigOption
- func WithPackageManager(p string) ConfigOption
- func WithResultWriter(w io.Writer) ConfigOption
- func WithRetryTimeout(d time.Duration) ConfigOption
- func WithSleep(d time.Duration) ConfigOption
- func WithSpecFile(f string) ConfigOption
- func WithVarsBytes(v []byte) ConfigOption
- func WithVarsData(v any) ConfigOption
- func WithVarsFile(file string) ConfigOption
- func WithVarsString(v string) ConfigOption
- type OutputConfig
Constants ¶
const ( JSON format = "json" YAML format = "yaml" )
Variables ¶
This section is empty.
Functions ¶
func IsValueInList ¶ added in v0.3.6
func ValidateSections ¶ added in v0.3.3
Types ¶
type Command ¶
type Command struct { Cmd *exec.Cmd Stdout, Stderr bytes.Buffer Err error Status int // contains filtered or unexported fields }
func NewCommand ¶
type Config ¶ added in v0.0.18
type Config struct { AllowInsecure bool AnnounceToCLI bool Cache time.Duration Debug bool Endpoint string FormatOptions []string IgnoreList []string ListenAddress string LocalAddress string LogLevel string MaxConcurrent int Method string NoColor *bool NoFollowRedirects bool OutputFormat string OutputWriter io.Writer PackageManager string Password string RequestBody string Proxy string RequestHeader []string RetryTimeout time.Duration RunLevel string Server string Sleep time.Duration Spec string Timeout time.Duration Username string CAFile string CertFile string KeyFile string Vars string VarsInline string DisabledResourceTypes []string }
Config is the runtime configuration for the goss system, the cli.Context gets converted to this and it allows other packages to embed goss by creating this structure and using it when adding, validating etc.
NewConfig can be used to create this which will default to what the CLI assumes and allow manipulation via ConfigOption functions
func NewConfig ¶ added in v0.3.21
func NewConfig(opts ...ConfigOption) (rc *Config, err error)
NewConfig creates a default configuration modeled on the defaults the CLI sets, modified using opts
func (*Config) TimeOutMilliSeconds ¶ added in v0.3.21
TimeOutMilliSeconds is the timeout as milliseconds
type ConfigOption ¶ added in v0.3.21
ConfigOption manipulates Config
func WithCache ¶ added in v0.3.21
func WithCache(d time.Duration) ConfigOption
WithCache sets how long results may be cached for
func WithDisabledResourceTypes ¶ added in v0.3.21
func WithDisabledResourceTypes(t ...string) ConfigOption
WithDisabledResourceTypes ensures that any resource matching types listed will be skipped when validating
func WithFormatOptions ¶ added in v0.3.21
func WithFormatOptions(opts ...string) ConfigOption
WithFormatOptions sets options used by the output format plugins, valid options are output.WithFormatOptions
func WithMaxConcurrency ¶ added in v0.3.21
func WithMaxConcurrency(mc int) ConfigOption
WithMaxConcurrency is the maximum concurrent test that can be run
func WithNoColor ¶ added in v0.3.21
func WithNoColor() ConfigOption
WithNoColor disables colored output
func WithOutputFormat ¶ added in v0.3.21
func WithOutputFormat(f string) ConfigOption
WithOutputFormat is the formatter to use for output
func WithPackageManager ¶ added in v0.3.21
func WithPackageManager(p string) ConfigOption
WithPackageManager overrides the package manager to use
func WithResultWriter ¶ added in v0.3.21
func WithResultWriter(w io.Writer) ConfigOption
WithResultWriter sets the writer to write output format to when validating
func WithRetryTimeout ¶ added in v0.3.21
func WithRetryTimeout(d time.Duration) ConfigOption
WithRetryTimeout sets the maximum amount of time checks can be retried, it's runtime + WithSleep
func WithSleep ¶ added in v0.3.21
func WithSleep(d time.Duration) ConfigOption
WithSleep sets the time to sleep between retries when WithRetryTimeout is set
func WithSpecFile ¶ added in v0.3.21
func WithSpecFile(f string) ConfigOption
WithSpecFile sets the path to the file holding spec contents
func WithVarsBytes ¶ added in v0.3.21
func WithVarsBytes(v []byte) ConfigOption
WithVarsBytes is a yaml or json byte stream to use as variables passed to the Validator
func WithVarsData ¶ added in v0.3.21
func WithVarsData(v any) ConfigOption
WithVarsData uses v as variables to pass to the Validator
func WithVarsFile ¶ added in v0.3.21
func WithVarsFile(file string) ConfigOption
WithVarsFile is a json or yaml file containing variables to pass to the validator
func WithVarsString ¶ added in v0.3.21
func WithVarsString(v string) ConfigOption
WithVarsString is a yaml or json string to use as variables passed to the Validator
type OutputConfig ¶ added in v0.3.6
type OutputConfig struct {
FormatOptions []string
}