resource

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2016 License: Apache-2.0 Imports: 11 Imported by: 2

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 {
	Address   string `json:"-"`
	Reachable bool   `json:"reachable"`
	Timeout   int    `json:"timeout"`
}

func NewAddr

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

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

type Command

type Command struct {
	Command    string   `json:"-"`
	ExitStatus string   `json:"exit-status"`
	Stdout     []string `json:"stdout"`
	Stderr     []string `json:"stderr"`
	Timeout    int      `json:"timeout"`
}

func NewCommand

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

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

type DNS

type DNS struct {
	Host        string   `json:"-"`
	Resolveable bool     `json:"resolveable"`
	Addrs       []string `json:"addrs,omitempty"`
	Timeout     int      `json:"timeout"`
}

func NewDNS

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

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

type File

type File struct {
	Path     string   `json:"-"`
	Exists   bool     `json:"exists"`
	Mode     string   `json:"mode,omitempty"`
	Owner    string   `json:"owner,omitempty"`
	Group    string   `json:"group,omitempty"`
	LinkedTo string   `json:"linked-to,omitempty"`
	Filetype string   `json:"filetype,omitempty"`
	Contains []string `json:"contains"`
}

func NewFile

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

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

type Gossfile

type Gossfile struct {
	Path string `json:"-"`
}

func NewGossfile

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

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

type Group

type Group struct {
	Groupname string `json:"-"`
	Exists    bool   `json:"exists"`
	Gid       string `json:"gid,omitempty"`
}

func NewGroup

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

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

type IDer added in v0.0.5

type IDer interface {
	ID() string
}

type Package

type Package struct {
	Name      string   `json:"-"`
	Installed bool     `json:"installed"`
	Versions  []string `json:"versions,omitempty"`
}

func NewPackage

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

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

type Port

type Port struct {
	Port      string   `json:"-"`
	Listening bool     `json:"listening"`
	IP        []string `json:"ip,omitempty"`
}

func NewPort

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

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

type Process

type Process struct {
	Executable string `json:"-"`
	Running    bool   `json:"running"`
}

func NewProcess

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

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

type Resource

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

type Service

type Service struct {
	Service string `json:"-"`
	Enabled bool   `json:"enabled"`
	Running bool   `json:"running"`
}

func NewService

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

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

type TestResult

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

func ValidateContains

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

func ValidateValue

func ValidateValue(res IDer, property string, expectedValue interface{}, method func() (interface{}, error)) TestResult

func ValidateValues

func ValidateValues(res IDer, property string, expectedValues []string, method func() ([]string, error)) TestResult

type User

type User struct {
	Username string   `json:"-"`
	Exists   bool     `json:"exists"`
	UID      string   `json:"uid,omitempty"`
	GID      string   `json:"gid,omitempty"`
	Groups   []string `json:"groups,omitempty"`
	Home     string   `json:"home,omitempty"`
}

func NewUser

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

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

Jump to

Keyboard shortcuts

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