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(varsFile string, varsInline string) (func([]byte) ([]byte, error), error)
- func RenderJSON(c *util.Config) (string, error)
- func Serve(c *util.Config) error
- func Validate(c *util.Config, startTime time.Time) (code int, err error)
- func ValidateResults(c *util.Config) (results <-chan []resource.TestResult, err error)
- func WriteJSON(filePath string, gossConfig GossConfig) error
- type GossConfig
- type TemplateFilter
- type TmplVars
Constants ¶
const ( UNSET = iota JSON YAML )
Variables ¶
This section is empty.
Functions ¶
func AddResource ¶ added in v0.1.0
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 ¶ added in v0.1.10
AddResources is a simple wrapper to add multiple resources
func AutoAddResource ¶ added in v0.1.0
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 ¶ added in v0.1.10
AutoAddResources is a simple wrapper to add multiple resources
func NewTemplateFilter ¶ added in v0.3.0
NewTemplateFilter creates a new Template Filter based in the file and inline variables.
func RenderJSON ¶
RenderJSON reads json file recursively returning string
func Validate ¶ added in v0.1.0
Validate performs validation, writes formatted output to stdout by default and supports retries and more, this is the full featured Validate used by the typical CLI invocation and will produce output to StdOut. Use ValidateResults for programmatic access
func ValidateResults ¶ added in v0.3.21
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 GossConfig ¶ added in v0.1.0
type GossConfig 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"` 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"` }
func NewGossConfig ¶ added in v0.1.0
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 ¶ added in v0.3.21
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 ¶ added in v0.1.0
func (c *GossConfig) Resources() []resource.Resource
type TemplateFilter ¶ added in v0.3.0
TemplateFilter is the type of the Goss Template Filter which include custom variables and functions.