system

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2015 License: Apache-2.0 Imports: 22 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

func GetProcs added in v0.0.4

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

Types

type Addr

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

func NewDefAddr added in v0.0.4

func NewDefAddr(address string, system *System) Addr

type Command

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

func NewDefCommand added in v0.0.4

func NewDefCommand(command string, system *System) Command

type DNS

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

func NewDefDNS added in v0.0.4

func NewDefDNS(host string, system *System) 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() (interface{}, error)

func (*DebPackage) Installed added in v0.0.4

func (p *DebPackage) Installed() (interface{}, 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 int64
	// contains filtered or unexported fields
}

func (*DefAddr) Address added in v0.0.4

func (h *DefAddr) Address() string

func (*DefAddr) Exists added in v0.0.4

func (h *DefAddr) Exists() (interface{}, error)

func (*DefAddr) ID added in v0.0.4

func (h *DefAddr) ID() string

func (*DefAddr) Reachable added in v0.0.4

func (h *DefAddr) Reachable() (interface{}, error)

func (*DefAddr) SetTimeout added in v0.0.4

func (h *DefAddr) SetTimeout(t int64)

type DefCommand added in v0.0.4

type DefCommand struct {
	// 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() (interface{}, error)

Stub out

func (*DefCommand) ExitStatus added in v0.0.4

func (c *DefCommand) ExitStatus() (interface{}, 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 int64
	// 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() (interface{}, 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() (interface{}, error)

func (*DefDNS) SetTimeout added in v0.0.4

func (d *DefDNS) SetTimeout(t int64)

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() (interface{}, error)

func (*DefFile) Filetype added in v0.0.4

func (f *DefFile) Filetype() (interface{}, error)

func (*DefFile) Group added in v0.0.4

func (f *DefFile) Group() (interface{}, error)

func (*DefFile) LinkedTo added in v0.0.4

func (f *DefFile) LinkedTo() (interface{}, error)

func (*DefFile) Mode added in v0.0.4

func (f *DefFile) Mode() (interface{}, error)

func (*DefFile) Owner added in v0.0.4

func (f *DefFile) Owner() (interface{}, 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() (interface{}, 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() (interface{}, error)

func (*DefGroup) Gid added in v0.0.4

func (u *DefGroup) Gid() (interface{}, 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() (interface{}, error)

func (*DefPort) IP added in v0.0.4

func (p *DefPort) IP() (interface{}, error)

func (*DefPort) Listening added in v0.0.4

func (p *DefPort) Listening() (interface{}, 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() (interface{}, 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() (interface{}, 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() (interface{}, error)

func (*DefUser) GID added in v0.0.4

func (u *DefUser) GID() (interface{}, 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() (interface{}, error)

func (*DefUser) UID added in v0.0.4

func (u *DefUser) UID() (interface{}, error)

func (*DefUser) Username added in v0.0.4

func (u *DefUser) Username() string

type File

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

func NewDefFile added in v0.0.4

func NewDefFile(path string, system *System) File

type Gossfile

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

func NewDefGossfile added in v0.0.4

func NewDefGossfile(path string, system *System) Gossfile

type Group

type Group interface {
	Groupname() string
	Exists() (interface{}, error)
	Gid() (interface{}, error)
}

func NewDefGroup added in v0.0.4

func NewDefGroup(groupname string, system *System) 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() (interface{}, error)

func (*NullPackage) Installed added in v0.0.4

func (p *NullPackage) Installed() (interface{}, 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() (interface{}, error)
	Installed() (interface{}, error)
	Versions() ([]string, error)
}

func NewDebPackage added in v0.0.4

func NewDebPackage(name string, system *System) Package

func NewNullPackage added in v0.0.4

func NewNullPackage(name string, system *System) Package

func NewRpmPackage added in v0.0.4

func NewRpmPackage(name string, system *System) Package

type Port

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

func NewDefPort added in v0.0.4

func NewDefPort(port string, system *System) Port

type Process

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

func NewDefProcess added in v0.0.4

func NewDefProcess(executable string, system *System) Process

type Resource

type Resource interface {
	Exists() (interface{}, 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() (interface{}, error)

func (*RpmPackage) Installed added in v0.0.4

func (p *RpmPackage) Installed() (interface{}, 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() (interface{}, error)
	Enabled() (interface{}, error)
	Running() (interface{}, error)
}

func NewServiceDbus

func NewServiceDbus(service string, system *System) Service

func NewServiceInit

func NewServiceInit(service string, system *System) Service

type ServiceDbus

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

func (*ServiceDbus) Enabled

func (s *ServiceDbus) Enabled() (interface{}, error)

func (*ServiceDbus) Exists added in v0.0.2

func (s *ServiceDbus) Exists() (interface{}, error)

func (*ServiceDbus) Running

func (s *ServiceDbus) Running() (interface{}, 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() (interface{}, error)

func (*ServiceInit) Exists added in v0.0.2

func (s *ServiceInit) Exists() (interface{}, error)

func (*ServiceInit) Running

func (s *ServiceInit) Running() (interface{}, error)

func (*ServiceInit) Service

func (s *ServiceInit) Service() string

type System

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

func New

func New(c *cli.Context) *System

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() (interface{}, error)
	UID() (interface{}, error)
	GID() (interface{}, error)
	Groups() ([]string, error)
	Home() (interface{}, error)
}

func NewDefUser added in v0.0.4

func NewDefUser(username string, system *System) User

Jump to

Keyboard shortcuts

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