Documentation
¶
Index ¶
- Constants
- func AddResource(fileName string, gossConfig GossConfig, resourceName, key string, ...) error
- func AddResources(fileName, resourceName string, keys []string, c *util.Config) error
- func AutoAddResource(fileName string, gossConfig GossConfig, key string, c *util.Config, ...) error
- func AutoAddResources(fileName string, keys []string, c *util.Config) error
- func NewTemplateFilter(varsFiles []string, varsInline string, discovered map[string]bool) (func([]byte) ([]byte, error), error)
- func RenderJSON(c *util.Config) (string, error)
- func Serve(c *util.Config) error
- func Validate(c *util.Config) (code int, err error)
- func ValidateConfig(c *util.Config, gossConfig *GossConfig) (code int, err error)
- func ValidateResults(c *util.Config) (results <-chan []resource.TestResult, err error)
- func WriteJSON(filePath string, gossConfig GossConfig) error
- type DiscoveryConfig
- type DiscoveryEntry
- type GossConfig
- type TemplateFilter
- type TmplVars
Constants ¶
const ( UNSET = iota JSON YAML )
Variables ¶
This section is empty.
Functions ¶
func AddResource ¶
func AddResource(fileName string, gossConfig GossConfig, resourceName, key string, config util.Config, sys *system.System) error
AddResource adds a single resource to fileName
func AddResources ¶
AddResources is a simple wrapper to add multiple resources
func AutoAddResource ¶
func AutoAddResource(fileName string, gossConfig GossConfig, key string, c *util.Config, sys *system.System) error
AutoAddResource adds a single resource to fileName with automatic detection of the type of resource
func AutoAddResources ¶
AutoAddResources is a simple wrapper to add multiple resources
func NewTemplateFilter ¶
func NewTemplateFilter(varsFiles []string, varsInline string, discovered map[string]bool) (func([]byte) ([]byte, error), error)
NewTemplateFilter creates a new Template Filter based in the file and inline variables.
func RenderJSON ¶
RenderJSON reads json file recursively returning string
func Validate ¶
Validate performs validation, writes formatted output to stdout by default and supports retries and more, this is the full featured Validate used by the CLI invocation and will produce output to StdOut. Use ValidateResults for programmatic access
func ValidateConfig ¶
func ValidateConfig(c *util.Config, gossConfig *GossConfig) (code int, err error)
func ValidateResults ¶
func ValidateResults(c *util.Config) (results <-chan []resource.TestResult, err error)
ValidateResults performs validation and provides programmatic access to validation results no retries or outputs are supported
func WriteJSON ¶
func WriteJSON(filePath string, gossConfig GossConfig) error
Types ¶
type DiscoveryConfig ¶
type DiscoveryConfig struct {
Files resource.FileMap `json:"file,omitempty" yaml:"file,omitempty"`
Packages resource.PackageMap `json:"package,omitempty" yaml:"package,omitempty"`
Addrs resource.AddrMap `json:"addr,omitempty" yaml:"addr,omitempty"`
Ports resource.PortMap `json:"port,omitempty" yaml:"port,omitempty"`
Services resource.ServiceMap `json:"service,omitempty" yaml:"service,omitempty"`
Users resource.UserMap `json:"user,omitempty" yaml:"user,omitempty"`
Groups resource.GroupMap `json:"group,omitempty" yaml:"group,omitempty"`
Commands resource.CommandMap `json:"command,omitempty" yaml:"command,omitempty"`
DNS resource.DNSMap `json:"dns,omitempty" yaml:"dns,omitempty"`
Processes resource.ProcessMap `json:"process,omitempty" yaml:"process,omitempty"`
KernelParams resource.KernelParamMap `json:"kernel-param,omitempty" yaml:"kernel-param,omitempty"`
Mounts resource.MountMap `json:"mount,omitempty" yaml:"mount,omitempty"`
Interfaces resource.InterfaceMap `json:"interface,omitempty" yaml:"interface,omitempty"`
HTTPs resource.HTTPMap `json:"http,omitempty" yaml:"http,omitempty"`
Matchings resource.MatchingMap `json:"matching,omitempty" yaml:"matching,omitempty"`
Registries resource.RegistryMap `json:"registry,omitempty" yaml:"registry,omitempty"`
}
DiscoveryConfig holds discovery-phase tests keyed by resource type.
func (*DiscoveryConfig) Entries ¶
func (c *DiscoveryConfig) Entries() ([]DiscoveryEntry, error)
func (*DiscoveryConfig) IsEmpty ¶
func (c *DiscoveryConfig) IsEmpty() bool
func (*DiscoveryConfig) Merge ¶
func (c *DiscoveryConfig) Merge(g2 DiscoveryConfig)
type DiscoveryEntry ¶
DiscoveryEntry pairs a register name with a discovery resource.
type GossConfig ¶
type GossConfig struct {
Discovery DiscoveryConfig `json:"discovery,omitempty" yaml:"discovery,omitempty"`
Files resource.FileMap `json:"file,omitempty" yaml:"file,omitempty"`
Packages resource.PackageMap `json:"package,omitempty" yaml:"package,omitempty"`
Addrs resource.AddrMap `json:"addr,omitempty" yaml:"addr,omitempty"`
Ports resource.PortMap `json:"port,omitempty" yaml:"port,omitempty"`
Services resource.ServiceMap `json:"service,omitempty" yaml:"service,omitempty"`
Users resource.UserMap `json:"user,omitempty" yaml:"user,omitempty"`
Groups resource.GroupMap `json:"group,omitempty" yaml:"group,omitempty"`
Commands resource.CommandMap `json:"command,omitempty" yaml:"command,omitempty"`
DNS resource.DNSMap `json:"dns,omitempty" yaml:"dns,omitempty"`
Processes resource.ProcessMap `json:"process,omitempty" yaml:"process,omitempty"`
Gossfiles resource.GossfileMap `json:"gossfile,omitempty" yaml:"gossfile,omitempty"`
KernelParams resource.KernelParamMap `json:"kernel-param,omitempty" yaml:"kernel-param,omitempty"`
Mounts resource.MountMap `json:"mount,omitempty" yaml:"mount,omitempty"`
Interfaces resource.InterfaceMap `json:"interface,omitempty" yaml:"interface,omitempty"`
HTTPs resource.HTTPMap `json:"http,omitempty" yaml:"http,omitempty"`
Matchings resource.MatchingMap `json:"matching,omitempty" yaml:"matching,omitempty"`
Registries resource.RegistryMap `json:"registry,omitempty" yaml:"registry,omitempty"`
}
func NewGossConfig ¶
func NewGossConfig() *GossConfig
func ReadJSON ¶
func ReadJSON(filePath string) (GossConfig, error)
ReadJSON Reads json file returning GossConfig
func ReadJSONData ¶
func ReadJSONData(data []byte, detectFormat bool) (GossConfig, error)
ReadJSONData Reads json byte array returning GossConfig
func (*GossConfig) Merge ¶
func (c *GossConfig) Merge(g2 GossConfig)
Merge consumes all the resources in g2 into c, duplicate resources will be overwritten with the ones in g2
func (*GossConfig) Resources ¶
func (c *GossConfig) Resources() []resource.Resource
type TemplateFilter ¶
TemplateFilter is the type of the Goss Template Filter which include custom variables and functions.
func NewPeekTemplateFilter ¶
func NewPeekTemplateFilter(varsFiles []string, varsInline string) (TemplateFilter, error)
NewPeekTemplateFilter renders templates before discovery results exist. Missing .Discovered keys evaluate as false instead of failing template execution.
