resource

package
v0.3.21 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AddrResourceKey = "addr"
	AddResourceName = "Addr"
)
View Source
const (
	CommandResourceKey  = "command"
	CommandResourceName = "Command"
)
View Source
const (
	DNSResourceKey  = "dns"
	DNSResourceName = "DNS"
)
View Source
const (
	FileResourceKey  = "file"
	FileResourceName = "File"
)
View Source
const (
	GossFileResourceKey  = "gossfile"
	GossFileResourceName = "Gossfile"
)
View Source
const (
	GroupResourceKey  = "group"
	GroupResourceName = "Group"
)
View Source
const (
	HTTPResourceKey  = "http"
	HTTPResourceName = "HTTP"
)
View Source
const (
	InterfaceResourceKey  = "interface"
	InterfaceResourceName = "Interface"
)
View Source
const (
	KernelParamResourceKey  = "kernel-param"
	KernelParamResourceName = "KernelParam"
)
View Source
const (
	MatchingResourceKey  = "mount"
	MatchingResourceName = "Mount"
)
View Source
const (
	MountResourceKey  = "mount"
	MountResourceName = "Mount"
)
View Source
const (
	PackageResourceKey  = "package"
	PackageResourceName = "Package"
)
View Source
const (
	PortResourceKey  = "port"
	PortResourceName = "Port"
)
View Source
const (
	ProcessResourceKey  = "process"
	ProcessResourceName = "Process"
)
View Source
const (
	ServiceResourceKey  = "service"
	ServiceResourceName = "Service"
)
View Source
const (
	UserResourceKey  = "user"
	UserResourceName = "User"
)
View Source
const (
	Value = iota
	Values
	Contains
)
View Source
const (
	SUCCESS = iota
	FAIL
	SKIP
	UNKNOWN
)
View Source
const (
	OutcomePass    = "pass"
	OutcomeFail    = "fail"
	OutcomeSkip    = "skip"
	OutcomeUnknown = "unknown"
)

Variables

This section is empty.

Functions

func HumanOutcomes added in v0.3.21

func HumanOutcomes() map[int]string

func Resources added in v0.3.21

func Resources() map[string]Resource

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:"-"`
	LocalAddress string  `json:"local-address,omitempty" yaml:"local-address,omitempty"`
	Reachable    matcher `json:"reachable" yaml:"reachable"`
	Timeout      int     `json:"timeout" yaml:"timeout"`
	Skip         bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
}

func NewAddr

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

func (*Addr) GetMeta added in v0.1.1

func (a *Addr) GetMeta() meta

func (*Addr) GetTitle added in v0.1.1

func (a *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) SetSkip added in v0.3.21

func (a *Addr) SetSkip()

func (*Addr) TypeKey added in v0.3.21

func (a *Addr) TypeKey() string

func (*Addr) TypeName added in v0.3.21

func (a *Addr) TypeName() 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, error)

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 any) 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:"-"`
	Exec       string   `json:"exec,omitempty" yaml:"exec,omitempty"`
	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"`
	Skip       bool     `json:"skip,omitempty" yaml:"skip,omitempty"`
}

func NewCommand

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

func (*Command) GetExec added in v0.3.7

func (c *Command) GetExec() string

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) SetSkip added in v0.3.21

func (c *Command) SetSkip()

func (*Command) TypeKey added in v0.3.21

func (c *Command) TypeKey() string

func (*Command) TypeName added in v0.3.21

func (c *Command) TypeName() 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, error)

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 any) 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"`
	Skip        bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
}

func NewDNS

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

func (*DNS) GetMeta added in v0.1.1

func (d *DNS) GetMeta() meta

func (*DNS) GetTitle added in v0.1.1

func (d *DNS) GetTitle() string

func (*DNS) ID added in v0.0.4

func (d *DNS) ID() string

func (*DNS) SetID added in v0.0.4

func (d *DNS) SetID(id string)

func (*DNS) SetSkip added in v0.3.21

func (d *DNS) SetSkip()

func (*DNS) TypeKey added in v0.3.21

func (d *DNS) TypeKey() string

func (*DNS) TypeName added in v0.3.21

func (d *DNS) TypeName() string

func (*DNS) Validate

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

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, error)

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 any) 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"`
	Sha512   matcher  `json:"sha512,omitempty" yaml:"sha512,omitempty"`
	Skip     bool     `json:"skip,omitempty" yaml:"skip,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) SetSkip added in v0.3.21

func (f *File) SetSkip()

func (*File) TypeKey added in v0.3.21

func (f *File) TypeKey() string

func (*File) TypeName added in v0.3.21

func (f *File) TypeName() 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, error)

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 any) 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:"-"`
	Skip  bool   `json:"skip,omitempty" yaml:"skip,omitempty"`
	File  string `json:"file,omitempty" yaml:"file,omitempty"`
}

func NewGossfile

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

func (*Gossfile) GetGossfile added in v0.3.21

func (g *Gossfile) GetGossfile() string

func (*Gossfile) GetMeta added in v0.1.1

func (g *Gossfile) GetMeta() meta

func (*Gossfile) GetSkip added in v0.3.21

func (g *Gossfile) GetSkip() bool

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)

func (*Gossfile) SetSkip added in v0.3.21

func (g *Gossfile) SetSkip()

func (*Gossfile) TypeKey added in v0.3.21

func (g *Gossfile) TypeKey() string

func (*Gossfile) TypeName added in v0.3.21

func (g *Gossfile) TypeName() string

func (*Gossfile) Validate added in v0.3.21

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

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, error)

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 any) 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"`
	Skip      bool    `json:"skip,omitempty" yaml:"skip,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) SetSkip added in v0.3.21

func (g *Group) SetSkip()

func (*Group) TypeKey added in v0.3.21

func (g *Group) TypeKey() string

func (*Group) TypeName added in v0.3.21

func (g *Group) TypeName() 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, error)

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 any) error) error

type HTTP added in v0.1.10

type HTTP struct {
	Title             string   `json:"title,omitempty" yaml:"title,omitempty"`
	URL               string   `json:"url,omitempty" yaml:"url,omitempty"`
	Meta              meta     `json:"meta,omitempty" yaml:"meta,omitempty"`
	HTTP              string   `json:"-" yaml:"-"`
	Method            string   `json:"method,omitempty" yaml:"method,omitempty"`
	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"`
	RequestHeader     []string `json:"request-headers,omitempty" yaml:"request-headers,omitempty"`
	RequestBody       string   `json:"request-body,omitemptyy" yaml:"request-body,omitempty"`
	Headers           []string `json:"headers,omitempty" yaml:"headers,omitempty"`
	Body              []string `json:"body" yaml:"body"`
	Username          string   `json:"username,omitempty" yaml:"username,omitempty"`
	Password          string   `json:"password,omitempty" yaml:"password,omitempty"`
	CAFile            string   `json:"ca-file,omitempty" yaml:"ca-file,omitempty"`
	CertFile          string   `json:"cert-file,omitempty" yaml:"cert-file,omitempty"`
	KeyFile           string   `json:"key-file,omitempty" yaml:"key-file,omitempty"`
	Skip              bool     `json:"skip,omitempty" yaml:"skip,omitempty"`
	Proxy             string   `json:"proxy,omitempty" yaml:"proxy,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 (u *HTTP) GetMeta() meta

func (*HTTP) GetTitle added in v0.1.10

func (u *HTTP) GetTitle() string

FIXME: Can this be refactored?

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) SetSkip added in v0.3.21

func (u *HTTP) SetSkip()

func (*HTTP) TypeKey added in v0.3.21

func (u *HTTP) TypeKey() string

func (*HTTP) TypeName added in v0.3.21

func (u *HTTP) TypeName() 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(sr 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, error)

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 any) 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"`
	Skip   bool    `json:"skip,omitempty" yaml:"skip,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) SetSkip added in v0.3.21

func (i *Interface) SetSkip()

func (*Interface) TypeKey added in v0.3.21

func (i *Interface) TypeKey() string

func (*Interface) TypeName added in v0.3.21

func (i *Interface) TypeName() 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, error)

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 any) 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"`
	Skip  bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
}

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 (a *KernelParam) GetMeta() meta

func (*KernelParam) GetTitle added in v0.1.8

func (a *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) SetSkip added in v0.3.21

func (a *KernelParam) SetSkip()

func (*KernelParam) TypeKey added in v0.3.21

func (a *KernelParam) TypeKey() string

func (*KernelParam) TypeName added in v0.3.21

func (a *KernelParam) TypeName() 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, error)

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 any) 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 any     `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) SetSkip added in v0.3.21

func (a *Matching) SetSkip()

func (*Matching) TypeKey added in v0.3.21

func (a *Matching) TypeKey() string

func (*Matching) TypeName added in v0.3.21

func (a *Matching) TypeName() 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 any) 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"`
	Skip       bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	Usage      matcher `json:"usage,omitempty" yaml:"usage,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) SetSkip added in v0.3.21

func (m *Mount) SetSkip()

func (*Mount) TypeKey added in v0.3.21

func (m *Mount) TypeKey() string

func (*Mount) TypeName added in v0.3.21

func (m *Mount) TypeName() 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, error)

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 any) 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"`
	Skip      bool    `json:"skip,omitempty" yaml:"skip,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) SetSkip added in v0.3.21

func (p *Package) SetSkip()

func (*Package) TypeKey added in v0.3.21

func (p *Package) TypeKey() string

func (*Package) TypeName added in v0.3.21

func (p *Package) TypeName() 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, error)

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 any) 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"`
	Skip      bool    `json:"skip,omitempty" yaml:"skip,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) SetSkip added in v0.3.21

func (p *Port) SetSkip()

func (*Port) TypeKey added in v0.3.21

func (p *Port) TypeKey() string

func (*Port) TypeName added in v0.3.21

func (p *Port) TypeName() 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, error)

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 any) 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"`
	Skip       bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
}

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) SetSkip added in v0.3.21

func (p *Process) SetSkip()

func (*Process) TypeKey added in v0.3.21

func (p *Process) TypeKey() string

func (*Process) TypeName added in v0.3.21

func (p *Process) TypeName() 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, error)

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 any) error) error

type Resource

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

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"`
	Skip    bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
}

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) SetSkip added in v0.3.21

func (s *Service) SetSkip()

func (*Service) TypeKey added in v0.3.21

func (s *Service) TypeKey() string

func (*Service) TypeName added in v0.3.21

func (s *Service) TypeName() 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, error)

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 any) error) error

type TestResult

type TestResult struct {
	Successful   bool           `json:"successful" yaml:"successful"`
	Skipped      bool           `json:"skipped" yaml:"skipped"`
	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          *ValidateError `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 any, actual any, skip bool) TestResult

func (TestResult) ToOutcome added in v0.3.21

func (tr TestResult) ToOutcome() string

ToOutcome converts the enum to a human-friendly string.

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"`
	Skip     bool    `json:"skip,omitempty" yaml:"skip,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) SetSkip added in v0.3.21

func (u *User) SetSkip()

func (*User) TypeKey added in v0.3.21

func (u *User) TypeKey() string

func (*User) TypeName added in v0.3.21

func (u *User) TypeName() 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, error)

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 any) error) error

type ValidateError added in v0.3.21

type ValidateError string

func (ValidateError) Error added in v0.3.21

func (g ValidateError) Error() string

Jump to

Keyboard shortcuts

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