resource

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddrResourceKey  = "addr"
	AddrResourceName = "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 (
	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  = "matching"
	MatchingResourceName = "Matching"
)
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 (
	RegistryResourceKey  = "registry"
	RegistryResourceName = "Registry"
)
View Source
const (
	ServiceResourceKey  = "service"
	ServiceResourceName = "Service"
)
View Source
const (
	SyverFileResourceKey  = "gossfile"
	SyverFileResourceName = "Gossfile"
)
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

func HumanOutcomes() map[int]string

func Ref

func Ref(res Resource) string

Ref returns the canonical dependency reference for a resource.

func Resources

func Resources() map[string]Resource

func YAMLKey

func YAMLKey(res Resource) string

YAMLKey returns the gossfile map key for a resource.

Types

type Addr

type Addr struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Address      string  `json:"address,omitempty" yaml:"address,omitempty"`
	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"`
	// contains filtered or unexported fields
}

func NewAddr

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

func (*Addr) GetAddress

func (a *Addr) GetAddress() string

func (*Addr) GetMeta

func (a *Addr) GetMeta() meta

func (*Addr) GetTitle

func (a *Addr) GetTitle() string

FIXME: Can this be refactored?

func (*Addr) ID

func (a *Addr) ID() string

func (*Addr) SetID

func (a *Addr) SetID(id string)

func (*Addr) SetSkip

func (a *Addr) SetSkip()

func (*Addr) TypeKey

func (a *Addr) TypeKey() string

func (*Addr) TypeName

func (a *Addr) TypeName() string

func (*Addr) Validate

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

type AddrMap

type AddrMap map[string]*Addr

func (AddrMap) AppendSysResource

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

func (AddrMap) AppendSysResourceIfExists

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

func (*AddrMap) UnmarshalJSON

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

func (*AddrMap) UnmarshalYAML

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

type Command

type Command struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Exec       string  `json:"exec,omitempty" yaml:"exec,omitempty"`
	ExitStatus matcher `json:"exit-status" yaml:"exit-status"`
	Stdout     matcher `json:"stdout" yaml:"stdout"`
	Stderr     matcher `json:"stderr" yaml:"stderr"`
	Timeout    int     `json:"timeout" yaml:"timeout"`
	Skip       bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	// contains filtered or unexported fields
}

func NewCommand

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

func (*Command) GetExec

func (c *Command) GetExec() string

func (*Command) GetMeta

func (c *Command) GetMeta() meta

func (*Command) GetTitle

func (c *Command) GetTitle() string

func (*Command) ID

func (c *Command) ID() string

func (*Command) SetID

func (c *Command) SetID(id string)

func (*Command) SetSkip

func (c *Command) SetSkip()

func (*Command) TypeKey

func (c *Command) TypeKey() string

func (*Command) TypeName

func (c *Command) TypeName() string

func (*Command) Validate

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

type CommandMap

type CommandMap map[string]*Command

func (CommandMap) AppendSysResource

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

func (CommandMap) AppendSysResourceIfExists

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

func (*CommandMap) UnmarshalJSON

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

func (*CommandMap) UnmarshalYAML

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

type DNS

type DNS struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Resolve     string  `json:"resolve,omitempty" yaml:"resolve,omitempty"`
	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"`
	// contains filtered or unexported fields
}

func NewDNS

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

func (*DNS) GetMeta

func (d *DNS) GetMeta() meta

func (*DNS) GetResolve

func (d *DNS) GetResolve() string

func (*DNS) GetTitle

func (d *DNS) GetTitle() string

func (*DNS) ID

func (d *DNS) ID() string

func (*DNS) SetID

func (d *DNS) SetID(id string)

func (*DNS) SetSkip

func (d *DNS) SetSkip()

func (*DNS) TypeKey

func (d *DNS) TypeKey() string

func (*DNS) TypeName

func (d *DNS) TypeName() string

func (*DNS) Validate

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

type DNSMap

type DNSMap map[string]*DNS

func (DNSMap) AppendSysResource

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

func (DNSMap) AppendSysResourceIfExists

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

func (*DNSMap) UnmarshalJSON

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

func (*DNSMap) UnmarshalYAML

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

type Dependent

type Dependent interface {
	Resource
	GetDependsOn() []string
}

Dependent resources declare prerequisite tests that must pass first.

type Discoverable

type Discoverable interface {
	Resource
	GetRegister() string
}

Discoverable resources expose a register name for discovery output.

type DiscoveryMeta

type DiscoveryMeta struct {
	Register  string   `json:"register,omitempty" yaml:"register,omitempty"`
	DependsOn []string `json:"depends-on,omitempty" yaml:"depends-on,omitempty"`
}

DiscoveryMeta holds optional discovery and dependency metadata shared by resources.

func (DiscoveryMeta) GetDependsOn

func (d DiscoveryMeta) GetDependsOn() []string

func (DiscoveryMeta) GetRegister

func (d DiscoveryMeta) GetRegister() string

type File

type File struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Path     string  `json:"path,omitempty" yaml:"path,omitempty"`
	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"`
	Uid      matcher `json:"uid,omitempty" yaml:"uid,omitempty"`
	Group    matcher `json:"group,omitempty" yaml:"group,omitempty"`
	Gid      matcher `json:"gid,omitempty" yaml:"gid,omitempty"`
	LinkedTo matcher `json:"linked-to,omitempty" yaml:"linked-to,omitempty"`
	Filetype matcher `json:"filetype,omitempty" yaml:"filetype,omitempty"`
	Contains matcher `json:"contains,omitempty" yaml:"contains,omitempty"`
	Contents matcher `json:"contents" yaml:"contents"`
	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"`
	// contains filtered or unexported fields
}

func NewFile

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

func (*File) GetMeta

func (f *File) GetMeta() meta

func (*File) GetPath

func (f *File) GetPath() string

func (*File) GetTitle

func (f *File) GetTitle() string

func (*File) ID

func (f *File) ID() string

func (*File) SetID

func (f *File) SetID(id string)

func (*File) SetSkip

func (f *File) SetSkip()

func (*File) TypeKey

func (f *File) TypeKey() string

func (*File) TypeName

func (f *File) TypeName() string

func (*File) Validate

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

type FileMap

type FileMap map[string]*File

func (FileMap) AppendSysResource

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

func (FileMap) AppendSysResourceIfExists

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

func (*FileMap) UnmarshalJSON

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

func (*FileMap) UnmarshalYAML

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

type Group

type Group struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Groupname string  `json:"groupname,omitempty" yaml:"groupname,omitempty"`
	Exists    matcher `json:"exists" yaml:"exists"`
	GID       matcher `json:"gid,omitempty" yaml:"gid,omitempty"`
	Skip      bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	// contains filtered or unexported fields
}

func NewGroup

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

func (*Group) GetGroupname

func (g *Group) GetGroupname() string

func (*Group) GetMeta

func (g *Group) GetMeta() meta

func (*Group) GetTitle

func (g *Group) GetTitle() string

func (*Group) ID

func (g *Group) ID() string

func (*Group) SetID

func (g *Group) SetID(id string)

func (*Group) SetSkip

func (g *Group) SetSkip()

func (*Group) TypeKey

func (g *Group) TypeKey() string

func (*Group) TypeName

func (g *Group) TypeName() string

func (*Group) Validate

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

type GroupMap

type GroupMap map[string]*Group

func (GroupMap) AppendSysResource

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

func (GroupMap) AppendSysResourceIfExists

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

func (*GroupMap) UnmarshalJSON

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

func (*GroupMap) UnmarshalYAML

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

type HTTP

type HTTP struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	URL                string              `json:"url,omitempty" yaml:"url,omitempty"`
	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,omitempty" yaml:"timeout,omitempty"`
	RequestHeader      []string            `json:"request-headers,omitempty" yaml:"request-headers,omitempty"`
	RequestQueryParams map[string][]string `json:"request-query-params,omitempty" yaml:"request-query-params,omitempty"`
	RequestBody        string              `json:"request-body,omitempty" yaml:"request-body,omitempty"`
	Headers            matcher             `json:"headers,omitempty" yaml:"headers,omitempty"`
	Body               matcher             `json:"body,omitempty" yaml:"body,omitempty"`
	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"`
	// contains filtered or unexported fields
}

func NewHTTP

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

func (*HTTP) GetMeta

func (r *HTTP) GetMeta() meta

func (*HTTP) GetTitle

func (r *HTTP) GetTitle() string

FIXME: Can this be refactored?

func (*HTTP) ID

func (h *HTTP) ID() string

func (*HTTP) SetID

func (h *HTTP) SetID(id string)

func (*HTTP) SetSkip

func (u *HTTP) SetSkip()

func (*HTTP) TypeKey

func (u *HTTP) TypeKey() string

func (*HTTP) TypeName

func (u *HTTP) TypeName() string

func (*HTTP) Validate

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

type HTTPMap

type HTTPMap map[string]*HTTP

func (HTTPMap) AppendSysResource

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

func (HTTPMap) AppendSysResourceIfExists

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

func (*HTTPMap) UnmarshalJSON

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

func (*HTTPMap) UnmarshalYAML

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

type Interface

type Interface struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Name   string  `json:"name,omitempty" yaml:"name,omitempty"`
	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"`
	// contains filtered or unexported fields
}

func NewInterface

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

func (*Interface) GetMeta

func (i *Interface) GetMeta() meta

func (*Interface) GetName

func (i *Interface) GetName() string

func (*Interface) GetTitle

func (i *Interface) GetTitle() string

FIXME: Can this be refactored?

func (*Interface) ID

func (i *Interface) ID() string

func (*Interface) SetID

func (i *Interface) SetID(id string)

func (*Interface) SetSkip

func (i *Interface) SetSkip()

func (*Interface) TypeKey

func (i *Interface) TypeKey() string

func (*Interface) TypeName

func (i *Interface) TypeName() string

func (*Interface) Validate

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

type InterfaceMap

type InterfaceMap map[string]*Interface

func (InterfaceMap) AppendSysResource

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

func (InterfaceMap) AppendSysResourceIfExists

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

func (*InterfaceMap) UnmarshalJSON

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

func (*InterfaceMap) UnmarshalYAML

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

type KernelParam

type KernelParam struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Name  string  `json:"name,omitempty" yaml:"name,omitempty"`
	Key   string  `json:"-" yaml:"-"`
	Value matcher `json:"value" yaml:"value"`
	Skip  bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	// contains filtered or unexported fields
}

func NewKernelParam

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

func (*KernelParam) GetMeta

func (k *KernelParam) GetMeta() meta

func (*KernelParam) GetName

func (k *KernelParam) GetName() string

func (*KernelParam) GetTitle

func (k *KernelParam) GetTitle() string

FIXME: Can this be refactored?

func (*KernelParam) ID

func (k *KernelParam) ID() string

func (*KernelParam) SetID

func (a *KernelParam) SetID(id string)

func (*KernelParam) SetSkip

func (a *KernelParam) SetSkip()

func (*KernelParam) TypeKey

func (a *KernelParam) TypeKey() string

func (*KernelParam) TypeName

func (a *KernelParam) TypeName() string

func (*KernelParam) Validate

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

type KernelParamMap

type KernelParamMap map[string]*KernelParam

func (KernelParamMap) AppendSysResource

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

func (KernelParamMap) AppendSysResourceIfExists

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

func (*KernelParamMap) UnmarshalJSON

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

func (*KernelParamMap) UnmarshalYAML

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

type Matching

type Matching struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`
	Content       any    `json:"content,omitempty" yaml:"content,omitempty"`
	AsReader      bool   `json:"as-reader,omitempty" yaml:"as-reader,omitempty"`

	Matches matcher `json:"matches" yaml:"matches"`
	Skip    bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	// contains filtered or unexported fields
}

func (*Matching) GetMeta

func (r *Matching) GetMeta() meta

func (*Matching) GetTitle

func (r *Matching) GetTitle() string

FIXME: Can this be refactored?

func (*Matching) ID

func (a *Matching) ID() string

func (*Matching) SetID

func (a *Matching) SetID(id string)

func (*Matching) SetSkip

func (a *Matching) SetSkip()

func (*Matching) TypeKey

func (a *Matching) TypeKey() string

func (*Matching) TypeName

func (a *Matching) TypeName() string

func (*Matching) Validate

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

type MatchingMap

type MatchingMap map[string]*Matching

func (*MatchingMap) UnmarshalJSON

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

func (*MatchingMap) UnmarshalYAML

func (ret *MatchingMap) UnmarshalYAML(unmarshal func(v any) error) error

type Mount

type Mount struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	MountPoint string  `json:"mountpoint,omitempty" yaml:"mountpoint,omitempty"`
	Exists     matcher `json:"exists" yaml:"exists"`
	Opts       matcher `json:"opts,omitempty" yaml:"opts,omitempty"`
	VfsOpts    matcher `json:"vfs-opts,omitempty" yaml:"vfs-opts,omitempty"`
	Source     matcher `json:"source,omitempty" yaml:"source,omitempty"`
	Filesystem matcher `json:"filesystem,omitempty" yaml:"filesystem,omitempty"`
	Timeout    int     `json:"timeout" yaml:"timeout"`
	Skip       bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	Usage      matcher `json:"usage,omitempty" yaml:"usage,omitempty"`
	// contains filtered or unexported fields
}

func NewMount

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

func (*Mount) GetMeta

func (m *Mount) GetMeta() meta

func (*Mount) GetMountPoint

func (m *Mount) GetMountPoint() string

func (*Mount) GetTitle

func (m *Mount) GetTitle() string

FIXME: Can this be refactored?

func (*Mount) ID

func (m *Mount) ID() string

func (*Mount) SetID

func (m *Mount) SetID(id string)

func (*Mount) SetSkip

func (m *Mount) SetSkip()

func (*Mount) TypeKey

func (m *Mount) TypeKey() string

func (*Mount) TypeName

func (m *Mount) TypeName() string

func (*Mount) Validate

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

type MountMap

type MountMap map[string]*Mount

func (MountMap) AppendSysResource

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

func (MountMap) AppendSysResourceIfExists

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

func (*MountMap) UnmarshalJSON

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

func (*MountMap) UnmarshalYAML

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

type Package

type Package struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Name      string  `json:"name,omitempty" yaml:"name,omitempty"`
	Installed matcher `json:"installed" yaml:"installed"`
	Versions  matcher `json:"versions,omitempty" yaml:"versions,omitempty"`
	Skip      bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	// contains filtered or unexported fields
}

func NewPackage

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

func (*Package) GetMeta

func (p *Package) GetMeta() meta

func (*Package) GetName

func (p *Package) GetName() string

func (*Package) GetTitle

func (p *Package) GetTitle() string

func (*Package) ID

func (p *Package) ID() string

func (*Package) SetID

func (p *Package) SetID(id string)

func (*Package) SetSkip

func (p *Package) SetSkip()

func (*Package) TypeKey

func (p *Package) TypeKey() string

func (*Package) TypeName

func (p *Package) TypeName() string

func (*Package) Validate

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

type PackageMap

type PackageMap map[string]*Package

func (PackageMap) AppendSysResource

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

func (PackageMap) AppendSysResourceIfExists

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

func (*PackageMap) UnmarshalJSON

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

func (*PackageMap) UnmarshalYAML

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

type Port

type Port struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Port      string  `json:"port,omitempty" yaml:"port,omitempty"`
	Listening matcher `json:"listening" yaml:"listening"`
	IP        matcher `json:"ip,omitempty" yaml:"ip,omitempty"`
	PID       matcher `json:"pid,omitempty" yaml:"pid,omitempty"`
	Skip      bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	// contains filtered or unexported fields
}

func NewPort

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

func (*Port) GetMeta

func (p *Port) GetMeta() meta

func (*Port) GetPort

func (p *Port) GetPort() string

func (*Port) GetTitle

func (p *Port) GetTitle() string

func (*Port) ID

func (p *Port) ID() string

func (*Port) SetID

func (p *Port) SetID(id string)

func (*Port) SetSkip

func (p *Port) SetSkip()

func (*Port) TypeKey

func (p *Port) TypeKey() string

func (*Port) TypeName

func (p *Port) TypeName() string

func (*Port) Validate

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

type PortMap

type PortMap map[string]*Port

func (PortMap) AppendSysResource

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

func (PortMap) AppendSysResourceIfExists

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

func (*PortMap) UnmarshalJSON

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

func (*PortMap) UnmarshalYAML

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

type Process

type Process struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Comm    string  `json:"comm,omitempty" yaml:"comm,omitempty"`
	Running matcher `json:"running" yaml:"running"`
	Status  matcher `json:"status,omitempty" yaml:"status,omitempty"`
	User    matcher `json:"user,omitempty" yaml:"user,omitempty"`
	Skip    bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	// contains filtered or unexported fields
}

func NewProcess

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

func (*Process) GetComm

func (p *Process) GetComm() string

func (*Process) GetMeta

func (p *Process) GetMeta() meta

func (*Process) GetTitle

func (p *Process) GetTitle() string

func (*Process) ID

func (p *Process) ID() string

func (*Process) SetID

func (p *Process) SetID(id string)

func (*Process) SetSkip

func (p *Process) SetSkip()

func (*Process) TypeKey

func (p *Process) TypeKey() string

func (*Process) TypeName

func (p *Process) TypeName() string

func (*Process) Validate

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

type ProcessMap

type ProcessMap map[string]*Process

func (ProcessMap) AppendSysResource

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

func (ProcessMap) AppendSysResourceIfExists

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

func (*ProcessMap) UnmarshalJSON

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

func (*ProcessMap) UnmarshalYAML

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

type Registry

type Registry struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Name   string  `json:"name,omitempty" yaml:"name,omitempty"`
	Exists matcher `json:"exists" yaml:"exists"`
	Value  matcher `json:"value,omitempty" yaml:"value,omitempty"`
	Type   matcher `json:"type,omitempty" yaml:"type,omitempty"`
	Skip   bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry(sysRegistry system.Registry, config util.Config) (*Registry, error)

func (*Registry) GetMeta

func (r *Registry) GetMeta() meta

func (*Registry) GetName

func (r *Registry) GetName() string

func (*Registry) GetTitle

func (r *Registry) GetTitle() string

func (*Registry) ID

func (r *Registry) ID() string

func (*Registry) SetID

func (r *Registry) SetID(id string)

func (*Registry) SetSkip

func (r *Registry) SetSkip()

func (*Registry) TypeKey

func (r *Registry) TypeKey() string

func (*Registry) TypeName

func (r *Registry) TypeName() string

func (*Registry) Validate

func (r *Registry) Validate(sys *system.System) []TestResult

type RegistryMap

type RegistryMap map[string]*Registry

func (RegistryMap) AppendSysResource

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

func (RegistryMap) AppendSysResourceIfExists

func (r RegistryMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Registry, system.Registry, bool, error)

func (*RegistryMap) UnmarshalJSON

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

func (*RegistryMap) UnmarshalYAML

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

type Resource

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

type ResourceRead

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

type Service

type Service struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Name      string  `json:"name,omitempty" yaml:"name,omitempty"`
	Enabled   matcher `json:"enabled" yaml:"enabled"`
	Running   matcher `json:"running" yaml:"running"`
	Skip      bool    `json:"skip,omitempty" yaml:"skip,omitempty"`
	RunLevels matcher `json:"runlevels,omitempty" yaml:"runlevels,omitempty"`
	// contains filtered or unexported fields
}

func NewService

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

func (*Service) GetMeta

func (s *Service) GetMeta() meta

func (*Service) GetName

func (s *Service) GetName() string

func (*Service) GetTitle

func (s *Service) GetTitle() string

func (*Service) ID

func (s *Service) ID() string

func (*Service) SetID

func (s *Service) SetID(id string)

func (*Service) SetSkip

func (s *Service) SetSkip()

func (*Service) TypeKey

func (s *Service) TypeKey() string

func (*Service) TypeName

func (s *Service) TypeName() string

func (*Service) Validate

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

type ServiceMap

type ServiceMap map[string]*Service

func (ServiceMap) AppendSysResource

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

func (ServiceMap) AppendSysResourceIfExists

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

func (*ServiceMap) UnmarshalJSON

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

func (*ServiceMap) UnmarshalYAML

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

type Syverfile

type Syverfile struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	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 NewSyverfile

func NewSyverfile(sysSyverfile system.Syverfile, config util.Config) (*Syverfile, error)

func (*Syverfile) GetMeta

func (g *Syverfile) GetMeta() meta

func (*Syverfile) GetSkip

func (g *Syverfile) GetSkip() bool

func (*Syverfile) GetSyverfile

func (g *Syverfile) GetSyverfile() string

func (*Syverfile) GetTitle

func (g *Syverfile) GetTitle() string

func (*Syverfile) ID

func (g *Syverfile) ID() string

func (*Syverfile) SetID

func (g *Syverfile) SetID(id string)

func (*Syverfile) SetSkip

func (g *Syverfile) SetSkip()

func (*Syverfile) TypeKey

func (g *Syverfile) TypeKey() string

func (*Syverfile) TypeName

func (g *Syverfile) TypeName() string

func (*Syverfile) Validate

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

type SyverfileMap

type SyverfileMap map[string]*Syverfile

func (SyverfileMap) AppendSysResource

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

func (SyverfileMap) AppendSysResourceIfExists

func (r SyverfileMap) AppendSysResourceIfExists(sr string, sys *system.System) (*Syverfile, system.Syverfile, bool, error)

func (*SyverfileMap) UnmarshalJSON

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

func (*SyverfileMap) UnmarshalYAML

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

type TestResult

type TestResult struct {
	Successful bool `json:"successful" yaml:"successful"`
	Skipped    bool `json:"skipped" yaml:"skipped"`
	// Resource data
	ResourceId   string `json:"resource-id" yaml:"resource-id"`
	ResourceType string `json:"resource-type" yaml:"resource-type"`
	Property     string `json:"property" yaml:"property"`

	// User added info
	Title string `json:"title" yaml:"title"`
	Meta  meta   `json:"meta" yaml:"meta"`

	// Result
	Result        int                    `json:"result" yaml:"result"`
	Err           *ValidateError         `json:"err" yaml:"err"`
	MatcherResult matchers.MatcherResult `json:"matcher-result" yaml:"matcher-result"`
	StartTime     time.Time              `json:"start-time" yaml:"start-time"`
	EndTime       time.Time              `json:"end-time" yaml:"end-time"`
	Duration      time.Duration          `json:"duration" yaml:"duration"`
}

func SkipResourceResults

func SkipResourceResults(res Resource, reason string) []TestResult

SkipResourceResults emits skip results for every validated property on a resource.

func ValidateGomegaValue

func ValidateGomegaValue(res ResourceRead, property string, expectedValue any, actual any, skip bool) TestResult

func ValidateValue

func ValidateValue(res ResourceRead, property string, expectedValue any, actual any, skip bool) TestResult

func (TestResult) SortKey

func (t TestResult) SortKey() string

func (TestResult) ToOutcome

func (tr TestResult) ToOutcome() string

ToOutcome converts the enum to a human-friendly string.

type User

type User struct {
	DiscoveryMeta `yaml:",inline" json:",inline"`
	Title         string `json:"title,omitempty" yaml:"title,omitempty"`
	Meta          meta   `json:"meta,omitempty" yaml:"meta,omitempty"`

	Username string  `json:"username,omitempty" yaml:"username,omitempty"`
	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"`
	// contains filtered or unexported fields
}

func NewUser

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

func (*User) GetMeta

func (u *User) GetMeta() meta

func (*User) GetTitle

func (u *User) GetTitle() string

func (*User) GetUsername

func (u *User) GetUsername() string

func (*User) ID

func (u *User) ID() string

func (*User) SetID

func (u *User) SetID(id string)

func (*User) SetSkip

func (u *User) SetSkip()

func (*User) TypeKey

func (u *User) TypeKey() string

func (*User) TypeName

func (u *User) TypeName() string

func (*User) Validate

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

type UserMap

type UserMap map[string]*User

func (UserMap) AppendSysResource

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

func (UserMap) AppendSysResourceIfExists

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

func (*UserMap) UnmarshalJSON

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

func (*UserMap) UnmarshalYAML

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

type ValidateError

type ValidateError string

func (ValidateError) Error

func (g ValidateError) Error() string

Jump to

Keyboard shortcuts

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