resource

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	Address   string `json:"address"`
	Reachable bool   `json:"reachable"`
	Timeout   int64  `json:"timeout"`
}

func NewAddr

func NewAddr(sysAddr system.Addr) *Addr

func (*Addr) Validate

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

type AddrSlice added in v0.0.3

type AddrSlice []*Addr

func (*AddrSlice) Append added in v0.0.3

func (r *AddrSlice) Append(neles ...*Addr) bool

func (*AddrSlice) AppendSysResource added in v0.0.3

func (r *AddrSlice) AppendSysResource(sr string, sys *system.System) (*Addr, system.Addr, bool)

func (*AddrSlice) AppendSysResourceIfExists added in v0.0.3

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

type Command

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

func NewCommand

func NewCommand(sysCommand system.Command) *Command

func (*Command) Validate

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

type CommandSlice added in v0.0.3

type CommandSlice []*Command

func (*CommandSlice) Append added in v0.0.3

func (r *CommandSlice) Append(neles ...*Command) bool

func (*CommandSlice) AppendSysResource added in v0.0.3

func (r *CommandSlice) AppendSysResource(sr string, sys *system.System) (*Command, system.Command, bool)

func (*CommandSlice) AppendSysResourceIfExists added in v0.0.3

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

type DNS

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

func NewDNS

func NewDNS(sysDNS system.DNS) *DNS

func (*DNS) Validate

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

type DNSSlice added in v0.0.3

type DNSSlice []*DNS

func (*DNSSlice) Append added in v0.0.3

func (r *DNSSlice) Append(neles ...*DNS) bool

func (*DNSSlice) AppendSysResource added in v0.0.3

func (r *DNSSlice) AppendSysResource(sr string, sys *system.System) (*DNS, system.DNS, bool)

func (*DNSSlice) AppendSysResourceIfExists added in v0.0.3

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

type File

type File struct {
	Path     string   `json:"path"`
	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) *File

func (*File) Validate

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

type FileSlice added in v0.0.3

type FileSlice []*File

func (*FileSlice) Append added in v0.0.3

func (r *FileSlice) Append(neles ...*File) bool

func (*FileSlice) AppendSysResource added in v0.0.3

func (r *FileSlice) AppendSysResource(sr string, sys *system.System) (*File, system.File, bool)

func (*FileSlice) AppendSysResourceIfExists added in v0.0.3

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

type Gossfile

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

func NewGossfile

func NewGossfile(sysGossfile system.Gossfile) *Gossfile

type GossfileSlice added in v0.0.3

type GossfileSlice []*Gossfile

func (*GossfileSlice) Append added in v0.0.3

func (r *GossfileSlice) Append(neles ...*Gossfile) bool

func (*GossfileSlice) AppendSysResource added in v0.0.3

func (r *GossfileSlice) AppendSysResource(sr string, sys *system.System) (*Gossfile, system.Gossfile, bool)

func (*GossfileSlice) AppendSysResourceIfExists added in v0.0.3

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

type Group

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

func NewGroup

func NewGroup(sysGroup system.Group) *Group

func (*Group) Validate

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

type GroupSlice added in v0.0.3

type GroupSlice []*Group

func (*GroupSlice) Append added in v0.0.3

func (r *GroupSlice) Append(neles ...*Group) bool

func (*GroupSlice) AppendSysResource added in v0.0.3

func (r *GroupSlice) AppendSysResource(sr string, sys *system.System) (*Group, system.Group, bool)

func (*GroupSlice) AppendSysResourceIfExists added in v0.0.3

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

type Package

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

func NewPackage

func NewPackage(sysPackage system.Package) *Package

func (*Package) Validate

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

type PackageSlice added in v0.0.3

type PackageSlice []*Package

func (*PackageSlice) Append added in v0.0.3

func (r *PackageSlice) Append(neles ...*Package) bool

func (*PackageSlice) AppendSysResource added in v0.0.3

func (r *PackageSlice) AppendSysResource(sr string, sys *system.System) (*Package, system.Package, bool)

func (*PackageSlice) AppendSysResourceIfExists added in v0.0.3

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

type Port

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

func NewPort

func NewPort(sysPort system.Port) *Port

func (*Port) Validate

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

type PortSlice added in v0.0.3

type PortSlice []*Port

func (*PortSlice) Append added in v0.0.3

func (r *PortSlice) Append(neles ...*Port) bool

func (*PortSlice) AppendSysResource added in v0.0.3

func (r *PortSlice) AppendSysResource(sr string, sys *system.System) (*Port, system.Port, bool)

func (*PortSlice) AppendSysResourceIfExists added in v0.0.3

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

type Process

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

func NewProcess

func NewProcess(sysProcess system.Process) *Process

func (*Process) Validate

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

type ProcessSlice added in v0.0.3

type ProcessSlice []*Process

func (*ProcessSlice) Append added in v0.0.3

func (r *ProcessSlice) Append(neles ...*Process) bool

func (*ProcessSlice) AppendSysResource added in v0.0.3

func (r *ProcessSlice) AppendSysResource(sr string, sys *system.System) (*Process, system.Process, bool)

func (*ProcessSlice) AppendSysResourceIfExists added in v0.0.3

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

type Resource

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

type Service

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

func NewService

func NewService(sysService system.Service) *Service

func (*Service) Validate

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

type ServiceSlice added in v0.0.3

type ServiceSlice []*Service

func (*ServiceSlice) Append added in v0.0.3

func (r *ServiceSlice) Append(neles ...*Service) bool

func (*ServiceSlice) AppendSysResource added in v0.0.3

func (r *ServiceSlice) AppendSysResource(sr string, sys *system.System) (*Service, system.Service, bool)

func (*ServiceSlice) AppendSysResourceIfExists added in v0.0.3

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

type TestResult

type TestResult struct {
	Result   bool
	Desc     string
	Duration time.Duration
}

func ValidateContains

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

func ValidateValue

func ValidateValue(title, property, expectedValue interface{}, method func() (interface{}, error)) TestResult

func ValidateValues

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

type User

type User struct {
	Username string   `json:"username"`
	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) *User

func (*User) Validate

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

type UserSlice added in v0.0.3

type UserSlice []*User

func (*UserSlice) Append added in v0.0.3

func (r *UserSlice) Append(neles ...*User) bool

func (*UserSlice) AppendSysResource added in v0.0.3

func (r *UserSlice) AppendSysResource(sr string, sys *system.System) (*User, system.User, bool)

func (*UserSlice) AppendSysResourceIfExists added in v0.0.3

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

Jump to

Keyboard shortcuts

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