system

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 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() map[string]map[string]string

Types

type Addr

type Addr struct {
	Timeout int64
	// contains filtered or unexported fields
}

func NewAddr

func NewAddr(address string, system *System) *Addr

func (*Addr) Address

func (h *Addr) Address() string

func (*Addr) Reachable

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

type Command

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

func NewCommand

func NewCommand(command string, system *System) *Command

func (*Command) Command

func (c *Command) Command() string

func (*Command) ExitStatus

func (c *Command) ExitStatus() (interface{}, error)

func (*Command) Stderr

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

func (*Command) Stdout

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

type DNS

type DNS struct {
	Timeout int64
	// contains filtered or unexported fields
}

func NewDNS

func NewDNS(host string, system *System) *DNS

func (*DNS) Addrs

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

func (*DNS) Host

func (d *DNS) Host() string

func (*DNS) Resolveable

func (d *DNS) Resolveable() (interface{}, error)

type File

type File struct {
	ID string
	// contains filtered or unexported fields
}

func NewFile

func NewFile(path string, system *System) *File

func (*File) Contains

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

func (*File) Exists

func (f *File) Exists() (interface{}, error)

func (*File) Filetype

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

func (*File) Group

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

func (*File) LinkedTo

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

func (*File) Mode

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

func (*File) Owner

func (f *File) Owner() (interface{}, error)

func (*File) Path

func (f *File) Path() string

type Gossfile

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

func NewGossfile

func NewGossfile(path string, system *System) *Gossfile

func (*Gossfile) Path

func (g *Gossfile) Path() string

type Group

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

func NewGroup

func NewGroup(groupname string, system *System) *Group

func (*Group) Exists

func (u *Group) Exists() (interface{}, error)

func (*Group) Gid

func (u *Group) Gid() (interface{}, error)

func (*Group) Groupname

func (u *Group) Groupname() string

type Package

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

func NewPackageDeb

func NewPackageDeb(name string, system *System) Package

func NewPackageNull

func NewPackageNull(name string, system *System) Package

func NewPackageRpm

func NewPackageRpm(name string, system *System) Package

type PackageDeb

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

func (*PackageDeb) Installed

func (p *PackageDeb) Installed() (interface{}, error)

func (*PackageDeb) Name

func (p *PackageDeb) Name() string

func (*PackageDeb) Versions

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

type PackageNull

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

func (*PackageNull) Installed

func (p *PackageNull) Installed() (interface{}, error)

func (*PackageNull) Name

func (p *PackageNull) Name() string

func (*PackageNull) Versions

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

type PackageRpm

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

func (*PackageRpm) Installed

func (p *PackageRpm) Installed() (interface{}, error)

func (*PackageRpm) Name

func (p *PackageRpm) Name() string

func (*PackageRpm) Versions

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

type Port

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

func NewPort

func NewPort(port string, system *System) *Port

func (*Port) IP

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

func (*Port) Listening

func (p *Port) Listening() (interface{}, error)

func (*Port) Port

func (p *Port) Port() string

type Process

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

func NewProcess

func NewProcess(executable string, system *System) *Process

func (*Process) Executable

func (p *Process) Executable() string

func (*Process) Running

func (p *Process) Running() (interface{}, error)

type Resource

type Resource interface{}

type Service

type Service interface {
	Service() string
	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) 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) 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]map[string]string

type User

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

func NewUser

func NewUser(username string, system *System) *User

func (*User) Exists

func (u *User) Exists() (interface{}, error)

func (*User) Gid

func (u *User) Gid() (interface{}, error)

func (*User) Groups

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

func (*User) Home

func (u *User) Home() (interface{}, error)

func (*User) UID

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

func (*User) Username

func (u *User) Username() string

Jump to

Keyboard shortcuts

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