system

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNullPackage = errors.New("Could not detect Package type on this system, please use --package flag to explicity set it")

Functions

func GetPorts

func GetPorts(lookupPids bool) map[string][]GOnetstat.Process

FIXME: Is there a better way to do this rather than ignoring errors?

func GetProcs added in v0.0.4

func GetProcs() map[string][]ps.Process

Types

type Addr

type Addr interface {
	Address() string
	Exists() (bool, error)
	Reachable() (bool, error)
}

func NewDefAddr added in v0.0.4

func NewDefAddr(address string, system *System, config util.Config) Addr

type AlpinePackage added in v0.0.20

type AlpinePackage struct {
	// contains filtered or unexported fields
}

func (*AlpinePackage) Exists added in v0.0.20

func (p *AlpinePackage) Exists() (bool, error)

func (*AlpinePackage) Installed added in v0.0.20

func (p *AlpinePackage) Installed() (bool, error)

func (*AlpinePackage) Name added in v0.0.20

func (p *AlpinePackage) Name() string

func (*AlpinePackage) Versions added in v0.0.20

func (p *AlpinePackage) Versions() ([]string, error)

type Command

type Command interface {
	Command() string
	Exists() (bool, error)
	ExitStatus() (int, error)
	Stdout() (io.Reader, error)
	Stderr() (io.Reader, error)
}

func NewDefCommand added in v0.0.4

func NewDefCommand(command string, system *System, config util.Config) Command

type DNS

type DNS interface {
	Host() string
	Addrs() ([]string, error)
	Resolveable() (bool, error)
	Exists() (bool, error)
}

func NewDefDNS added in v0.0.4

func NewDefDNS(host string, system *System, config util.Config) DNS

type DebPackage added in v0.0.4

type DebPackage struct {
	// contains filtered or unexported fields
}

func (*DebPackage) Exists added in v0.0.4

func (p *DebPackage) Exists() (bool, error)

func (*DebPackage) Installed added in v0.0.4

func (p *DebPackage) Installed() (bool, error)

func (*DebPackage) Name added in v0.0.4

func (p *DebPackage) Name() string

func (*DebPackage) Versions added in v0.0.4

func (p *DebPackage) Versions() ([]string, error)

type DefAddr added in v0.0.4

type DefAddr struct {
	Timeout int
	// contains filtered or unexported fields
}

func (*DefAddr) Address added in v0.0.4

func (a *DefAddr) Address() string

func (*DefAddr) Exists added in v0.0.4

func (a *DefAddr) Exists() (bool, error)

func (*DefAddr) ID added in v0.0.4

func (a *DefAddr) ID() string

func (*DefAddr) Reachable added in v0.0.4

func (a *DefAddr) Reachable() (bool, error)

type DefCommand added in v0.0.4

type DefCommand struct {
	Timeout int
	// contains filtered or unexported fields
}

func (*DefCommand) Command added in v0.0.4

func (c *DefCommand) Command() string

func (*DefCommand) Exists added in v0.0.4

func (c *DefCommand) Exists() (bool, error)

Stub out

func (*DefCommand) ExitStatus added in v0.0.4

func (c *DefCommand) ExitStatus() (int, error)

func (*DefCommand) Stderr added in v0.0.4

func (c *DefCommand) Stderr() (io.Reader, error)

func (*DefCommand) Stdout added in v0.0.4

func (c *DefCommand) Stdout() (io.Reader, error)

type DefDNS added in v0.0.4

type DefDNS struct {
	Timeout int
	// contains filtered or unexported fields
}

func (*DefDNS) Addrs added in v0.0.4

func (d *DefDNS) Addrs() ([]string, error)

func (*DefDNS) Exists added in v0.0.4

func (d *DefDNS) Exists() (bool, error)

Stub out

func (*DefDNS) Host added in v0.0.4

func (d *DefDNS) Host() string

func (*DefDNS) Resolveable added in v0.0.4

func (d *DefDNS) Resolveable() (bool, error)

type DefFile added in v0.0.4

type DefFile struct {
	// contains filtered or unexported fields
}

func (*DefFile) Contains added in v0.0.4

func (f *DefFile) Contains() (io.Reader, error)

func (*DefFile) Exists added in v0.0.4

func (f *DefFile) Exists() (bool, error)

func (*DefFile) Filetype added in v0.0.4

func (f *DefFile) Filetype() (string, error)

func (*DefFile) Group added in v0.0.4

func (f *DefFile) Group() (string, error)

func (*DefFile) LinkedTo added in v0.0.4

func (f *DefFile) LinkedTo() (string, error)

func (*DefFile) Mode added in v0.0.4

func (f *DefFile) Mode() (string, error)

func (*DefFile) Owner added in v0.0.4

func (f *DefFile) Owner() (string, error)

func (*DefFile) Path added in v0.0.4

func (f *DefFile) Path() string

type DefGossfile added in v0.0.4

type DefGossfile struct {
	// contains filtered or unexported fields
}

func (*DefGossfile) Exists added in v0.0.4

func (g *DefGossfile) Exists() (bool, error)

Stub out

func (*DefGossfile) Path added in v0.0.4

func (g *DefGossfile) Path() string

type DefGroup added in v0.0.4

type DefGroup struct {
	// contains filtered or unexported fields
}

func (*DefGroup) Exists added in v0.0.4

func (u *DefGroup) Exists() (bool, error)

func (*DefGroup) GID added in v0.1.0

func (u *DefGroup) GID() (int, error)

func (*DefGroup) Groupname added in v0.0.4

func (u *DefGroup) Groupname() string

type DefPort added in v0.0.4

type DefPort struct {
	// contains filtered or unexported fields
}

func (*DefPort) Exists added in v0.0.4

func (p *DefPort) Exists() (bool, error)

func (*DefPort) IP added in v0.0.4

func (p *DefPort) IP() ([]string, error)

func (*DefPort) Listening added in v0.0.4

func (p *DefPort) Listening() (bool, error)

func (*DefPort) Port added in v0.0.4

func (p *DefPort) Port() string

type DefProcess added in v0.0.4

type DefProcess struct {
	// contains filtered or unexported fields
}

func (*DefProcess) Executable added in v0.0.4

func (p *DefProcess) Executable() string

func (*DefProcess) Exists added in v0.0.4

func (p *DefProcess) Exists() (bool, error)

func (*DefProcess) Pids added in v0.0.4

func (p *DefProcess) Pids() ([]int, error)

func (*DefProcess) Running added in v0.0.4

func (p *DefProcess) Running() (bool, error)

type DefUser added in v0.0.4

type DefUser struct {
	// contains filtered or unexported fields
}

func (*DefUser) Exists added in v0.0.4

func (u *DefUser) Exists() (bool, error)

func (*DefUser) GID added in v0.0.4

func (u *DefUser) GID() (int, error)

func (*DefUser) Groups added in v0.0.4

func (u *DefUser) Groups() ([]string, error)

func (*DefUser) Home added in v0.0.4

func (u *DefUser) Home() (string, error)

func (*DefUser) UID added in v0.0.4

func (u *DefUser) UID() (int, error)

func (*DefUser) Username added in v0.0.4

func (u *DefUser) Username() string

type File

type File interface {
	Path() string
	Exists() (bool, error)
	Contains() (io.Reader, error)
	Mode() (string, error)
	Filetype() (string, error)
	Owner() (string, error)
	Group() (string, error)
	LinkedTo() (string, error)
}

func NewDefFile added in v0.0.4

func NewDefFile(path string, system *System, config util.Config) File

type Gossfile

type Gossfile interface {
	Path() string
	Exists() (bool, error)
}

func NewDefGossfile added in v0.0.4

func NewDefGossfile(path string, system *System, config util.Config) Gossfile

type Group

type Group interface {
	Groupname() string
	Exists() (bool, error)
	GID() (int, error)
}

func NewDefGroup added in v0.0.4

func NewDefGroup(groupname string, system *System, config util.Config) Group

type NullPackage added in v0.0.4

type NullPackage struct {
	// contains filtered or unexported fields
}

func (*NullPackage) Exists added in v0.0.4

func (p *NullPackage) Exists() (bool, error)

func (*NullPackage) Installed added in v0.0.4

func (p *NullPackage) Installed() (bool, error)

func (*NullPackage) Name added in v0.0.4

func (p *NullPackage) Name() string

func (*NullPackage) Versions added in v0.0.4

func (p *NullPackage) Versions() ([]string, error)

type Package

type Package interface {
	Name() string
	Exists() (bool, error)
	Installed() (bool, error)
	Versions() ([]string, error)
}

func NewAlpinePackage added in v0.0.20

func NewAlpinePackage(name string, system *System, config util.Config) Package

func NewDebPackage added in v0.0.4

func NewDebPackage(name string, system *System, config util.Config) Package

func NewNullPackage added in v0.0.4

func NewNullPackage(name string, system *System, config util.Config) Package

func NewRpmPackage added in v0.0.4

func NewRpmPackage(name string, system *System, config util.Config) Package

type Port

type Port interface {
	Port() string
	Exists() (bool, error)
	Listening() (bool, error)
	IP() ([]string, error)
}

func NewDefPort added in v0.0.4

func NewDefPort(port string, system *System, config util.Config) Port

type Process

type Process interface {
	Executable() string
	Exists() (bool, error)
	Running() (bool, error)
	Pids() ([]int, error)
}

func NewDefProcess added in v0.0.4

func NewDefProcess(executable string, system *System, config util.Config) Process

type Resource

type Resource interface {
	Exists() (bool, error)
}

type RpmPackage added in v0.0.4

type RpmPackage struct {
	// contains filtered or unexported fields
}

func (*RpmPackage) Exists added in v0.0.4

func (p *RpmPackage) Exists() (bool, error)

func (*RpmPackage) Installed added in v0.0.4

func (p *RpmPackage) Installed() (bool, error)

func (*RpmPackage) Name added in v0.0.4

func (p *RpmPackage) Name() string

func (*RpmPackage) Versions added in v0.0.4

func (p *RpmPackage) Versions() ([]string, error)

type Service

type Service interface {
	Service() string
	Exists() (bool, error)
	Enabled() (bool, error)
	Running() (bool, error)
}

func NewAlpineServiceInit added in v0.0.20

func NewAlpineServiceInit(service string, system *System, config util.Config) Service

func NewServiceDbus

func NewServiceDbus(service string, system *System, config util.Config) Service

func NewServiceInit

func NewServiceInit(service string, system *System, config util.Config) Service

func NewServiceUpstart added in v0.0.14

func NewServiceUpstart(service string, system *System, config util.Config) Service

type ServiceDbus

type ServiceDbus struct {
	// contains filtered or unexported fields
}

func (*ServiceDbus) Enabled

func (s *ServiceDbus) Enabled() (bool, error)

func (*ServiceDbus) Exists added in v0.0.2

func (s *ServiceDbus) Exists() (bool, error)

func (*ServiceDbus) Running

func (s *ServiceDbus) Running() (bool, error)

func (*ServiceDbus) Service

func (s *ServiceDbus) Service() string

type ServiceInit

type ServiceInit struct {
	// contains filtered or unexported fields
}

func (*ServiceInit) Enabled

func (s *ServiceInit) Enabled() (bool, error)

func (*ServiceInit) Exists added in v0.0.2

func (s *ServiceInit) Exists() (bool, error)

func (*ServiceInit) Running

func (s *ServiceInit) Running() (bool, error)

func (*ServiceInit) Service

func (s *ServiceInit) Service() string

type ServiceUpstart added in v0.0.14

type ServiceUpstart struct {
	// contains filtered or unexported fields
}

func (*ServiceUpstart) Enabled added in v0.0.14

func (s *ServiceUpstart) Enabled() (bool, error)

func (*ServiceUpstart) Exists added in v0.0.14

func (s *ServiceUpstart) Exists() (bool, error)

func (*ServiceUpstart) Running added in v0.0.14

func (s *ServiceUpstart) Running() (bool, error)

func (*ServiceUpstart) Service added in v0.0.14

func (s *ServiceUpstart) Service() string

type System

type System struct {
	NewPackage  func(string, *System, util2.Config) Package
	NewFile     func(string, *System, util2.Config) File
	NewAddr     func(string, *System, util2.Config) Addr
	NewPort     func(string, *System, util2.Config) Port
	NewService  func(string, *System, util2.Config) Service
	NewUser     func(string, *System, util2.Config) User
	NewGroup    func(string, *System, util2.Config) Group
	NewCommand  func(string, *System, util2.Config) Command
	NewDNS      func(string, *System, util2.Config) DNS
	NewProcess  func(string, *System, util2.Config) Process
	NewGossfile func(string, *System, util2.Config) Gossfile
	// contains filtered or unexported fields
}

func New

func New(c *cli.Context) *System

func (*System) Dbus

func (s *System) Dbus() *dbus.Conn

func (*System) Ports

func (s *System) Ports() map[string][]GOnetstat.Process

func (*System) ProcMap added in v0.0.4

func (s *System) ProcMap() map[string][]ps.Process

type User

type User interface {
	Username() string
	Exists() (bool, error)
	UID() (int, error)
	GID() (int, error)
	Groups() ([]string, error)
	Home() (string, error)
}

func NewDefUser added in v0.0.4

func NewDefUser(username string, system *System, config util.Config) User

Jump to

Keyboard shortcuts

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