Documentation
¶
Index ¶
- Constants
- Variables
- func NewTemplateFilter(varsFile string) func([]byte) []byte
- func RenderJSON(gossfile *os.File, vars *os.File) string
- func WriteJSON(filePath string, gossConfig GossConfig) error
- type Add
- func (a *Add) AddResource(fileName string, gossConfig GossConfig, resourceName, key string, ...) error
- func (a *Add) AddResources(fileName, resourceName string, keys []string) error
- func (a *Add) AutoAddResource(fileName string, gossConfig GossConfig, key string) error
- func (a *Add) AutoAddResources(fileName string, keys []string) error
- type GossConfig
- type GossRunTime
- type HealthHandler
- type TmplVars
- type Validator
Constants ¶
const ( UNSET = iota JSON YAML )
Variables ¶
var OutStoreFormat = UNSET
var TemplateFilter func(data []byte) []byte
Functions ¶
func NewTemplateFilter ¶ added in v0.3.0
NewTemplateFilter creates a new filter with template extensions
func RenderJSON ¶
RenderJSON reads json file recursively returning string
func WriteJSON ¶
func WriteJSON(filePath string, gossConfig GossConfig) error
Types ¶
type Add ¶ added in v0.6.0
type Add struct { Writer io.Writer ExcludeAttr []string Timeout int AllowInsecure bool NoFollowRedirects bool Server string Username string Password string Header string Sys *system.System }
func (*Add) AddResource ¶ added in v0.6.0
func (a *Add) AddResource(fileName string, gossConfig GossConfig, resourceName, key string, config util.Config) error
AddResource adds a resource to the configuration file
func (*Add) AddResources ¶ added in v0.6.0
AddResources is a sSimple wrapper to add multiple resources
func (*Add) AutoAddResource ¶ added in v0.6.0
func (a *Add) AutoAddResource(fileName string, gossConfig GossConfig, key string) error
Autoadds all resources to the config file
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"` }
GossConfig represents the complete goss config file
func NewGossConfig ¶ added in v0.1.0
func NewGossConfig() *GossConfig
NewGossConfig is the constructor function
func ReadJSONData ¶
func ReadJSONData(data []byte, detectFormat bool) GossConfig
ReadJSONData reads json byte array returning GossConfig
func (*GossConfig) Resources ¶ added in v0.1.0
func (c *GossConfig) Resources() []resource.Resource
Resources returns a list of all resources
type GossRunTime ¶ added in v0.6.0
type GossRunTime struct { //Gossfile which should holds the test config Gossfile string //Vars file which holds the variabesl Vars string //Package defines which package manager you want to use, i.e. yum, apt, ... Package string //this does not belong here imho //Debug on true will create a more verbose output Debug bool }
GossRunTime represents the global runtime configs which can be set in goss
func (*GossRunTime) GetGossConfig ¶ added in v0.6.0
func (g *GossRunTime) GetGossConfig() GossConfig
GetGossConfig returns the goss configuration
func (*GossRunTime) Render ¶ added in v0.6.0
func (g *GossRunTime) Render() (string, error)
Render renders a template file
func (*GossRunTime) Serve ¶ added in v0.6.0
func (g *GossRunTime) Serve(endpoint string, handler *HealthHandler)
Serve serves a new health endpoint
func (*GossRunTime) Validate ¶ added in v0.6.0
func (g *GossRunTime) Validate(v *Validator) int
Validate starts the validation process
type HealthHandler ¶ added in v0.6.0
type HealthHandler struct { RunTimeConfig GossRunTime GossConfig GossConfig Sys *system.System Outputer outputs.Outputer Cache *cache.Cache GossMu *sync.Mutex ContentType string MaxConcurrent int ListenAddr string FormatOptions []string }
TODO: Maybe separating handler and server? HealthHandler creates a new handler for the health endpoint
func (*HealthHandler) Serve ¶ added in v0.6.0
func (h *HealthHandler) Serve(endpoint string)
Serve creates a new endpoint and starts the http server
func (HealthHandler) ServeHTTP ¶ added in v0.6.0
func (h HealthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP fulfills the handler interface and is called as a handler on the health check request.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
development
|
|
mock_system
Package mock_system is a generated GoMock package.
|
Package mock_system is a generated GoMock package. |