resource

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Value = iota
	Values
	Contains
	Header
)
View Source
const (
	SUCCESS = iota
	FAIL
	SKIP
)
View Source
const DefaultTimeoutMS = 500
View Source
const TimeoutMS = 5000

Variables

View Source
var BlacklistedAutoAddHeaders = [...]string{"Set-Cookie", "set-cookie", "Date", "date"}

Functions

This section is empty.

Types

type Addr

type Addr struct {
	Title     string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta      meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	Address   string  `json:"-" yaml:"-"`
	Reachable matcher `json:"reachable" yaml:"reachable"`
	Timeout   int     `json:"timeout" yaml:"timeout"`
}

Addr resource validates a addr, i.e. tcp://127.0.0.1:80

func NewAddr

func NewAddr(sysAddr system.Addr, config util.Config) (*Addr, error)

func (*Addr) GetMeta added in v0.1.1

func (r *Addr) GetMeta() meta

func (*Addr) GetTitle added in v0.1.1

func (r *Addr) GetTitle() string

FIXME: Can this be refactored?

func (*Addr) ID added in v0.0.4

func (a *Addr) ID() string

func (*Addr) SetID added in v0.0.4

func (a *Addr) SetID(id string)

func (*Addr) Validate

func (a *Addr) Validate(sys *system.System) []TestResult

type AddrMap added in v0.0.4

type AddrMap map[string]*Addr

func (AddrMap) AppendSysResource added in v0.0.4

func (r AddrMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Addr, error)

func (AddrMap) AppendSysResourceIfExists added in v0.0.4

func (r AddrMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Addr, system.Addr, bool)

func (*AddrMap) UnmarshalJSON added in v0.0.4

func (ret *AddrMap) UnmarshalJSON(data []byte) error

func (*AddrMap) UnmarshalYAML added in v0.1.0

func (ret *AddrMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Command

type Command struct {
	Title      string   `json:"title,omitempty" yaml:"title,omitempty"`
	Meta       meta     `json:"meta,omitempty" yaml:"meta,omitempty"`
	Command    string   `json:"-" yaml:"-"`
	ExitStatus matcher  `json:"exit-status" yaml:"exit-status"`
	Stdout     []string `json:"stdout" yaml:"stdout"`
	Stderr     []string `json:"stderr" yaml:"stderr"`
	Timeout    int      `json:"timeout" yaml:"timeout"`
}

func NewCommand

func NewCommand(sysCommand system.Command, config util.Config) (*Command, error)

func (*Command) GetMeta added in v0.1.1

func (c *Command) GetMeta() meta

func (*Command) GetTitle added in v0.1.1

func (c *Command) GetTitle() string

func (*Command) ID added in v0.0.4

func (c *Command) ID() string

func (*Command) SetID added in v0.0.4

func (c *Command) SetID(id string)

func (*Command) Validate

func (c *Command) Validate(sys *system.System) []TestResult

type CommandMap added in v0.0.4

type CommandMap map[string]*Command

func (CommandMap) AppendSysResource added in v0.0.4

func (r CommandMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Command, error)

func (CommandMap) AppendSysResourceIfExists added in v0.0.4

func (r CommandMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Command, system.Command, bool)

func (*CommandMap) UnmarshalJSON added in v0.0.4

func (ret *CommandMap) UnmarshalJSON(data []byte) error

func (*CommandMap) UnmarshalYAML added in v0.1.0

func (ret *CommandMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type DNS

type DNS struct {
	Title       string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta        meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	Host        string  `json:"-" yaml:"-"`
	Resolveable matcher `json:"resolveable,omitempty" yaml:"resolveable,omitempty"`
	Resolvable  matcher `json:"resolvable" yaml:"resolvable"`
	Addrs       matcher `json:"addrs,omitempty" yaml:"addrs,omitempty"`
	Timeout     int     `json:"timeout" yaml:"timeout"`
	Server      string  `json:"server,omitempty" yaml:"server,omitempty"`
}

DNS represents the DNS resource

func NewDNS

func NewDNS(sysDNS system.DNS, config util.Config) (*DNS, error)

NewDNS is the constructor

func (*DNS) GetMeta added in v0.1.1

func (d *DNS) GetMeta() meta

/ GetMeta returns the meta of

func (*DNS) GetTitle added in v0.1.1

func (d *DNS) GetTitle() string

GetTitle returns the title

func (*DNS) ID added in v0.0.4

func (d *DNS) ID() string

ID returns the Host as the Identifier

func (*DNS) SetID added in v0.0.4

func (d *DNS) SetID(id string)

SetID sets the ID as Host

func (*DNS) Validate

func (d *DNS) Validate(sys *system.System) []TestResult

Validate validates the given resource

type DNSMap added in v0.0.4

type DNSMap map[string]*DNS

func (DNSMap) AppendSysResource added in v0.0.4

func (r DNSMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*DNS, error)

func (DNSMap) AppendSysResourceIfExists added in v0.0.4

func (r DNSMap) AppendSysResourceIfExists(sr string, sys *system.System) (*DNS, system.DNS, bool)

func (*DNSMap) UnmarshalJSON added in v0.0.4

func (ret *DNSMap) UnmarshalJSON(data []byte) error

func (*DNSMap) UnmarshalYAML added in v0.1.0

func (ret *DNSMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type File

type File struct {
	Title    string   `json:"title,omitempty" yaml:"title,omitempty"`
	Meta     meta     `json:"meta,omitempty" yaml:"meta,omitempty"`
	Path     string   `json:"-" yaml:"-"`
	Exists   matcher  `json:"exists" yaml:"exists"`
	Mode     matcher  `json:"mode,omitempty" yaml:"mode,omitempty"`
	Size     matcher  `json:"size,omitempty" yaml:"size,omitempty"`
	Owner    matcher  `json:"owner,omitempty" yaml:"owner,omitempty"`
	Group    matcher  `json:"group,omitempty" yaml:"group,omitempty"`
	LinkedTo matcher  `json:"linked-to,omitempty" yaml:"linked-to,omitempty"`
	Filetype matcher  `json:"filetype,omitempty" yaml:"filetype,omitempty"`
	Contains []string `json:"contains" yaml:"contains"`
	Md5      matcher  `json:"md5,omitempty" yaml:"md5,omitempty"`
	Sha256   matcher  `json:"sha256,omitempty" yaml:"sha256,omitempty"`
}

func NewFile

func NewFile(sysFile system.File, config util.Config) (*File, error)

func (*File) GetMeta added in v0.1.1

func (f *File) GetMeta() meta

func (*File) GetTitle added in v0.1.1

func (f *File) GetTitle() string

func (*File) ID added in v0.0.4

func (f *File) ID() string

func (*File) SetID added in v0.0.4

func (f *File) SetID(id string)

func (*File) Validate

func (f *File) Validate(sys *system.System) []TestResult

type FileMap added in v0.0.4

type FileMap map[string]*File

func (FileMap) AppendSysResource added in v0.0.4

func (r FileMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*File, error)

func (FileMap) AppendSysResourceIfExists added in v0.0.4

func (r FileMap) AppendSysResourceIfExists(sr string, sys *system.System) (*File, system.File, bool)

func (*FileMap) UnmarshalJSON added in v0.0.4

func (ret *FileMap) UnmarshalJSON(data []byte) error

func (*FileMap) UnmarshalYAML added in v0.1.0

func (ret *FileMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Gossfile

type Gossfile struct {
	Title string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta  meta   `json:"meta,omitempty" yaml:"meta,omitempty"`
	Path  string `json:"-" yaml:"-"`
}

func NewGossfile

func NewGossfile(sysGossfile system.Gossfile, config util.Config) (*Gossfile, error)

func (*Gossfile) GetMeta added in v0.1.1

func (g *Gossfile) GetMeta() meta

func (*Gossfile) GetTitle added in v0.1.1

func (g *Gossfile) GetTitle() string

func (*Gossfile) ID added in v0.0.4

func (g *Gossfile) ID() string

func (*Gossfile) SetID added in v0.0.4

func (g *Gossfile) SetID(id string)

type GossfileMap added in v0.0.4

type GossfileMap map[string]*Gossfile

func (GossfileMap) AppendSysResource added in v0.0.4

func (r GossfileMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Gossfile, error)

func (GossfileMap) AppendSysResourceIfExists added in v0.0.4

func (r GossfileMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Gossfile, system.Gossfile, bool)

func (*GossfileMap) UnmarshalJSON added in v0.0.4

func (ret *GossfileMap) UnmarshalJSON(data []byte) error

func (*GossfileMap) UnmarshalYAML added in v0.1.0

func (ret *GossfileMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Group

type Group struct {
	Title     string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta      meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	Groupname string  `json:"-" yaml:"-"`
	Exists    matcher `json:"exists" yaml:"exists"`
	GID       matcher `json:"gid,omitempty" yaml:"gid,omitempty"`
}

func NewGroup

func NewGroup(sysGroup system.Group, config util.Config) (*Group, error)

func (*Group) GetMeta added in v0.1.1

func (g *Group) GetMeta() meta

func (*Group) GetTitle added in v0.1.1

func (g *Group) GetTitle() string

func (*Group) ID added in v0.0.4

func (g *Group) ID() string

func (*Group) SetID added in v0.0.4

func (g *Group) SetID(id string)

func (*Group) Validate

func (g *Group) Validate(sys *system.System) []TestResult

type GroupMap added in v0.0.4

type GroupMap map[string]*Group

func (GroupMap) AppendSysResource added in v0.0.4

func (r GroupMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Group, error)

func (GroupMap) AppendSysResourceIfExists added in v0.0.4

func (r GroupMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Group, system.Group, bool)

func (*GroupMap) UnmarshalJSON added in v0.0.4

func (ret *GroupMap) UnmarshalJSON(data []byte) error

func (*GroupMap) UnmarshalYAML added in v0.1.0

func (ret *GroupMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type HTTP added in v0.1.10

type HTTP struct {
	Title             string              `json:"title,omitempty" yaml:"title,omitempty"`
	Meta              meta                `json:"meta,omitempty" yaml:"meta,omitempty"`
	HTTP              string              `json:"-" yaml:"-"`
	Status            matcher             `json:"status" yaml:"status"`
	AllowInsecure     bool                `json:"allow-insecure" yaml:"allow-insecure"`
	NoFollowRedirects bool                `json:"no-follow-redirects" yaml:"no-follow-redirects"`
	Timeout           int                 `json:"timeout" yaml:"timeout"`
	Body              []string            `json:"body" yaml:"body"`
	Username          string              `json:"username,omitempty" yaml:"username,omitempty"`
	Password          string              `json:"password,omitempty" yaml:"password,omitempty"`
	Headers           map[string][]string `json:"headers,omitempty" yaml:"headers,omitempty"`
	RequestHeaders    map[string][]string `json:"request-headers,omitempty" yaml:"request-headers,omitempty"`
	Cert              string              `json:"cert,omitempty" yaml:"cert,omitempty"`
	Key               string              `json:"key,omitempty" yaml:"key,omitempty"`
}

func NewHTTP added in v0.1.10

func NewHTTP(sysHTTP system.HTTP, config util.Config) (*HTTP, error)

func (*HTTP) GetMeta added in v0.1.10

func (r *HTTP) GetMeta() meta

func (*HTTP) GetTitle added in v0.1.10

func (r *HTTP) GetTitle() string

func (*HTTP) ID added in v0.1.10

func (u *HTTP) ID() string

func (*HTTP) SetID added in v0.1.10

func (u *HTTP) SetID(id string)

func (*HTTP) Validate added in v0.1.10

func (u *HTTP) Validate(sys *system.System) []TestResult

type HTTPMap added in v0.1.10

type HTTPMap map[string]*HTTP

func (HTTPMap) AppendSysResource added in v0.1.10

func (r HTTPMap) AppendSysResource(src string, sys *system.System, config util.Config) (*HTTP, error)

func (HTTPMap) AppendSysResourceIfExists added in v0.1.10

func (r HTTPMap) AppendSysResourceIfExists(sr string, sys *system.System) (*HTTP, system.HTTP, bool)

func (*HTTPMap) UnmarshalJSON added in v0.1.10

func (ret *HTTPMap) UnmarshalJSON(data []byte) error

func (*HTTPMap) UnmarshalYAML added in v0.1.10

func (ret *HTTPMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Interface added in v0.1.8

type Interface struct {
	Title  string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta   meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	Name   string  `json:"-" yaml:"-"`
	Exists matcher `json:"exists" yaml:"exists"`
	Addrs  matcher `json:"addrs,omitempty" yaml:"addrs,omitempty"`
	MTU    matcher `json:"mtu,omitempty" yaml:"mtu,omitempty"`
}

func NewInterface added in v0.1.8

func NewInterface(sysInterface system.Interface, config util.Config) (*Interface, error)

func (*Interface) GetMeta added in v0.1.8

func (i *Interface) GetMeta() meta

func (*Interface) GetTitle added in v0.1.8

func (i *Interface) GetTitle() string

FIXME: Can this be refactored?

func (*Interface) ID added in v0.1.8

func (i *Interface) ID() string

func (*Interface) SetID added in v0.1.8

func (i *Interface) SetID(id string)

func (*Interface) Validate added in v0.1.8

func (i *Interface) Validate(sys *system.System) []TestResult

type InterfaceMap added in v0.1.8

type InterfaceMap map[string]*Interface

func (InterfaceMap) AppendSysResource added in v0.1.8

func (r InterfaceMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Interface, error)

func (InterfaceMap) AppendSysResourceIfExists added in v0.1.8

func (r InterfaceMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Interface, system.Interface, bool)

func (*InterfaceMap) UnmarshalJSON added in v0.1.8

func (ret *InterfaceMap) UnmarshalJSON(data []byte) error

func (*InterfaceMap) UnmarshalYAML added in v0.1.8

func (ret *InterfaceMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type KernelParam added in v0.1.8

type KernelParam struct {
	Title string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta  meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	Key   string  `json:"-" yaml:"-"`
	Value matcher `json:"value" yaml:"value"`
}

func NewKernelParam added in v0.1.8

func NewKernelParam(sysKernelParam system.KernelParam, config util.Config) (*KernelParam, error)

func (*KernelParam) GetMeta added in v0.1.8

func (r *KernelParam) GetMeta() meta

func (*KernelParam) GetTitle added in v0.1.8

func (r *KernelParam) GetTitle() string

FIXME: Can this be refactored?

func (*KernelParam) ID added in v0.1.8

func (a *KernelParam) ID() string

func (*KernelParam) SetID added in v0.1.8

func (a *KernelParam) SetID(id string)

func (*KernelParam) Validate added in v0.1.8

func (a *KernelParam) Validate(sys *system.System) []TestResult

type KernelParamMap added in v0.1.8

type KernelParamMap map[string]*KernelParam

func (KernelParamMap) AppendSysResource added in v0.1.8

func (r KernelParamMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*KernelParam, error)

func (KernelParamMap) AppendSysResourceIfExists added in v0.1.8

func (r KernelParamMap) AppendSysResourceIfExists(sr string, sys *system.System) (*KernelParam, system.KernelParam, bool)

func (*KernelParamMap) UnmarshalJSON added in v0.1.8

func (ret *KernelParamMap) UnmarshalJSON(data []byte) error

func (*KernelParamMap) UnmarshalYAML added in v0.1.8

func (ret *KernelParamMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Matching added in v0.3.3

type Matching struct {
	Title   string      `json:"title,omitempty" yaml:"title,omitempty"`
	Meta    meta        `json:"meta,omitempty" yaml:"meta,omitempty"`
	Content interface{} `json:"content,omitempty" yaml:"content,omitempty"`
	Id      string      `json:"-" yaml:"-"`
	Matches matcher     `json:"matches" yaml:"matches"`
}

func (*Matching) GetMeta added in v0.3.3

func (r *Matching) GetMeta() meta

func (*Matching) GetTitle added in v0.3.3

func (r *Matching) GetTitle() string

FIXME: Can this be refactored?

func (*Matching) ID added in v0.3.3

func (a *Matching) ID() string

func (*Matching) SetID added in v0.3.3

func (a *Matching) SetID(id string)

func (*Matching) Validate added in v0.3.3

func (a *Matching) Validate(sys *system.System) []TestResult

type MatchingMap added in v0.3.3

type MatchingMap map[string]*Matching

func (*MatchingMap) UnmarshalJSON added in v0.3.3

func (ret *MatchingMap) UnmarshalJSON(data []byte) error

func (*MatchingMap) UnmarshalYAML added in v0.3.3

func (ret *MatchingMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Mount added in v0.1.8

type Mount struct {
	Title      string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta       meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	MountPoint string  `json:"-" yaml:"-"`
	Exists     matcher `json:"exists" yaml:"exists"`
	Opts       matcher `json:"opts,omitempty" yaml:"opts,omitempty"`
	Source     matcher `json:"source,omitempty" yaml:"source,omitempty"`
	Filesystem matcher `json:"filesystem,omitempty" yaml:"filesystem,omitempty"`
}

func NewMount added in v0.1.8

func NewMount(sysMount system.Mount, config util.Config) (*Mount, error)

func (*Mount) GetMeta added in v0.1.8

func (m *Mount) GetMeta() meta

func (*Mount) GetTitle added in v0.1.8

func (m *Mount) GetTitle() string

FIXME: Can this be refactored?

func (*Mount) ID added in v0.1.8

func (m *Mount) ID() string

func (*Mount) SetID added in v0.1.8

func (m *Mount) SetID(id string)

func (*Mount) Validate added in v0.1.8

func (m *Mount) Validate(sys *system.System) []TestResult

type MountMap added in v0.1.8

type MountMap map[string]*Mount

func (MountMap) AppendSysResource added in v0.1.8

func (r MountMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Mount, error)

func (MountMap) AppendSysResourceIfExists added in v0.1.8

func (r MountMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Mount, system.Mount, bool)

func (*MountMap) UnmarshalJSON added in v0.1.8

func (ret *MountMap) UnmarshalJSON(data []byte) error

func (*MountMap) UnmarshalYAML added in v0.1.8

func (ret *MountMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Package

type Package struct {
	Title          string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta           meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	Name           string  `json:"-" yaml:"-"`
	Installed      matcher `json:"installed" yaml:"installed"`
	Versions       matcher `json:"versions,omitempty" yaml:"versions,omitempty"`
	PackageManager string  `json:"package-manager,omitempty" yaml:"package-manager,omitempty"`
}

func NewPackage

func NewPackage(sysPackage system.Package, config util.Config) (*Package, error)

func (*Package) GetMeta added in v0.1.1

func (p *Package) GetMeta() meta

func (*Package) GetTitle added in v0.1.1

func (p *Package) GetTitle() string

func (*Package) ID added in v0.0.4

func (p *Package) ID() string

func (*Package) SetID added in v0.0.4

func (p *Package) SetID(id string)

func (*Package) Validate

func (p *Package) Validate(sys *system.System) []TestResult

type PackageMap added in v0.0.4

type PackageMap map[string]*Package

func (PackageMap) AppendSysResource added in v0.0.4

func (r PackageMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Package, error)

func (PackageMap) AppendSysResourceIfExists added in v0.0.4

func (r PackageMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Package, system.Package, bool)

func (*PackageMap) UnmarshalJSON added in v0.0.4

func (ret *PackageMap) UnmarshalJSON(data []byte) error

func (*PackageMap) UnmarshalYAML added in v0.1.0

func (ret *PackageMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Port

type Port struct {
	Title     string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta      meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	Port      string  `json:"-" yaml:"-"`
	Listening matcher `json:"listening" yaml:"listening"`
	IP        matcher `json:"ip,omitempty" yaml:"ip,omitempty"`
}

func NewPort

func NewPort(sysPort system.Port, config util.Config) (*Port, error)

func (*Port) GetMeta added in v0.1.1

func (p *Port) GetMeta() meta

func (*Port) GetTitle added in v0.1.1

func (p *Port) GetTitle() string

func (*Port) ID added in v0.0.4

func (p *Port) ID() string

func (*Port) SetID added in v0.0.4

func (p *Port) SetID(id string)

func (*Port) Validate

func (p *Port) Validate(sys *system.System) []TestResult

type PortMap added in v0.0.4

type PortMap map[string]*Port

func (PortMap) AppendSysResource added in v0.0.4

func (r PortMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Port, error)

func (PortMap) AppendSysResourceIfExists added in v0.0.4

func (r PortMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Port, system.Port, bool)

func (*PortMap) UnmarshalJSON added in v0.0.4

func (ret *PortMap) UnmarshalJSON(data []byte) error

func (*PortMap) UnmarshalYAML added in v0.1.0

func (ret *PortMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Process

type Process struct {
	Title      string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta       meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	Executable string  `json:"-" yaml:"-"`
	Running    matcher `json:"running" yaml:"running"`
}

func NewProcess

func NewProcess(sysProcess system.Process, config util.Config) (*Process, error)

func (*Process) GetMeta added in v0.1.1

func (p *Process) GetMeta() meta

func (*Process) GetTitle added in v0.1.1

func (p *Process) GetTitle() string

func (*Process) ID added in v0.0.4

func (p *Process) ID() string

func (*Process) SetID added in v0.0.4

func (p *Process) SetID(id string)

func (*Process) Validate

func (p *Process) Validate(sys *system.System) []TestResult

type ProcessMap added in v0.0.4

type ProcessMap map[string]*Process

func (ProcessMap) AppendSysResource added in v0.0.4

func (r ProcessMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Process, error)

func (ProcessMap) AppendSysResourceIfExists added in v0.0.4

func (r ProcessMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Process, system.Process, bool)

func (*ProcessMap) UnmarshalJSON added in v0.0.4

func (ret *ProcessMap) UnmarshalJSON(data []byte) error

func (*ProcessMap) UnmarshalYAML added in v0.1.0

func (ret *ProcessMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Resource

type Resource interface {
	Validate(*system.System) []TestResult
	SetID(string)
}

A Resource defines a type on which tests can be executed, i.e. http or file

type ResourceRead added in v0.1.1

type ResourceRead interface {
	ID() string
	GetTitle() string
	GetMeta() meta
}

type Service

type Service struct {
	Title   string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta    meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	Service string  `json:"-" yaml:"-"`
	Enabled matcher `json:"enabled" yaml:"enabled"`
	Running matcher `json:"running" yaml:"running"`
}

func NewService

func NewService(sysService system.Service, config util.Config) (*Service, error)

func (*Service) GetMeta added in v0.1.1

func (s *Service) GetMeta() meta

func (*Service) GetTitle added in v0.1.1

func (s *Service) GetTitle() string

func (*Service) ID added in v0.0.4

func (s *Service) ID() string

func (*Service) SetID added in v0.0.4

func (s *Service) SetID(id string)

func (*Service) Validate

func (s *Service) Validate(sys *system.System) []TestResult

type ServiceMap added in v0.0.4

type ServiceMap map[string]*Service

func (ServiceMap) AppendSysResource added in v0.0.4

func (r ServiceMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*Service, error)

func (ServiceMap) AppendSysResourceIfExists added in v0.0.4

func (r ServiceMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Service, system.Service, bool)

func (*ServiceMap) UnmarshalJSON added in v0.0.4

func (ret *ServiceMap) UnmarshalJSON(data []byte) error

func (*ServiceMap) UnmarshalYAML added in v0.1.0

func (ret *ServiceMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

type TestResult

type TestResult struct {
	Successful   bool          `json:"successful" yaml:"successful"`
	ResourceId   string        `json:"resource-id" yaml:"resource-id"`
	ResourceType string        `json:"resource-type" yaml:"resource-type"`
	Title        string        `json:"title" yaml:"title"`
	Meta         meta          `json:"meta" yaml:"meta"`
	TestType     int           `json:"test-type" yaml:"test-type"`
	Result       int           `json:"result" yaml:"result"`
	Property     string        `json:"property" yaml:"property"`
	Err          error         `json:"err" yaml:"err"`
	Expected     []string      `json:"expected" yaml:"expected"`
	Found        []string      `json:"found" yaml:"found"`
	Human        string        `json:"human" yaml:"human"`
	Duration     time.Duration `json:"duration" yaml:"duration"`
}

func ValidateContains

func ValidateContains(res ResourceRead, property string, expectedValues []string, method func() (io.Reader, error), skip bool) TestResult

func ValidateValue

func ValidateValue(res ResourceRead, property string, expectedValue interface{}, actual interface{}, skip bool) TestResult

type User

type User struct {
	Title    string  `json:"title,omitempty" yaml:"title,omitempty"`
	Meta     meta    `json:"meta,omitempty" yaml:"meta,omitempty"`
	Username string  `json:"-" yaml:"-"`
	Exists   matcher `json:"exists" yaml:"exists"`
	UID      matcher `json:"uid,omitempty" yaml:"uid,omitempty"`
	GID      matcher `json:"gid,omitempty" yaml:"gid,omitempty"`
	Groups   matcher `json:"groups,omitempty" yaml:"groups,omitempty"`
	Home     matcher `json:"home,omitempty" yaml:"home,omitempty"`
	Shell    matcher `json:"shell,omitempty" yaml:"shell,omitempty"`
}

func NewUser

func NewUser(sysUser system.User, config util.Config) (*User, error)

func (*User) GetMeta added in v0.1.1

func (u *User) GetMeta() meta

func (*User) GetTitle added in v0.1.1

func (u *User) GetTitle() string

func (*User) ID added in v0.0.4

func (u *User) ID() string

func (*User) SetID added in v0.0.4

func (u *User) SetID(id string)

func (*User) Validate

func (u *User) Validate(sys *system.System) []TestResult

type UserMap added in v0.0.4

type UserMap map[string]*User

func (UserMap) AppendSysResource added in v0.0.4

func (r UserMap) AppendSysResource(sr string, sys *system.System, config util.Config) (*User, error)

func (UserMap) AppendSysResourceIfExists added in v0.0.4

func (r UserMap) AppendSysResourceIfExists(sr string, sys *system.System) (*User, system.User, bool)

func (*UserMap) UnmarshalJSON added in v0.0.4

func (ret *UserMap) UnmarshalJSON(data []byte) error

func (*UserMap) UnmarshalYAML added in v0.1.0

func (ret *UserMap) UnmarshalYAML(unmarshal func(v interface{}) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL