resource

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Value = iota
	Values
	Contains
)

Variables

This section is empty.

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 bool   `json:"reachable" yaml:"reachable"`
	Timeout   int    `json:"timeout" yaml:"timeout"`
}

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 (r *AddrMap) UnmarshalJSON(data []byte) error

func (*AddrMap) UnmarshalYAML added in v0.1.0

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

func (r *AddrMap) UnmarshalYAML(data []byte) 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 (r *CommandMap) UnmarshalJSON(data []byte) error

func (*CommandMap) UnmarshalYAML added in v0.1.0

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

func (r *CommandMap) UnmarshalYAML(data []byte) 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 bool    `json:"resolveable" yaml:"resolveable"`
	Addrs       matcher `json:"addrs,omitempty" yaml:"addrs,omitempty"`
	Timeout     int     `json:"timeout" yaml:"timeout"`
}

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

func (*DNSMap) UnmarshalJSON added in v0.0.4

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

func (*DNSMap) UnmarshalYAML added in v0.1.0

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

func (r *DNSMap) UnmarshalYAML(data []byte) 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   bool     `json:"exists" yaml:"exists"`
	Mode     matcher  `json:"mode,omitempty" yaml:"mode,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"`
}

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 (r *FileMap) UnmarshalJSON(data []byte) error

func (*FileMap) UnmarshalYAML added in v0.1.0

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

func (r *FileMap) UnmarshalYAML(data []byte) 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 (r *GossfileMap) UnmarshalJSON(data []byte) error

func (*GossfileMap) UnmarshalYAML added in v0.1.0

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

func (r *GossfileMap) UnmarshalYAML(data []byte) 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    bool    `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 (r *GroupMap) UnmarshalJSON(data []byte) error

func (*GroupMap) UnmarshalYAML added in v0.1.0

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

func (r *GroupMap) UnmarshalYAML(data []byte) 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 bool    `json:"installed" yaml:"installed"`
	Versions  matcher `json:"versions,omitempty" yaml:"versions,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 (r *PackageMap) UnmarshalJSON(data []byte) error

func (*PackageMap) UnmarshalYAML added in v0.1.0

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

func (r *PackageMap) UnmarshalYAML(data []byte) 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 bool    `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 (r *PortMap) UnmarshalJSON(data []byte) error

func (*PortMap) UnmarshalYAML added in v0.1.0

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

func (r *PortMap) UnmarshalYAML(data []byte) 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    bool   `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 (r *ProcessMap) UnmarshalJSON(data []byte) error

func (*ProcessMap) UnmarshalYAML added in v0.1.0

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

func (r *ProcessMap) UnmarshalYAML(data []byte) error {

type Resource

type Resource interface {
	Validate(*system.System) []TestResult
	SetID(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 bool   `json:"enabled" yaml:"enabled"`
	Running bool   `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 (r *ServiceMap) UnmarshalJSON(data []byte) error

func (*ServiceMap) UnmarshalYAML added in v0.1.0

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

func (r *ServiceMap) UnmarshalYAML(data []byte) 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"`
	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)) TestResult

func ValidateValue

func ValidateValue(res ResourceRead, property string, expectedValue interface{}, actual interface{}) 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   bool    `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"`
}

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 (r *UserMap) UnmarshalJSON(data []byte) error

func (*UserMap) UnmarshalYAML added in v0.1.0

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

func (r *UserMap) UnmarshalYAML(data []byte) error {

Jump to

Keyboard shortcuts

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