remoteops

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindDNSServers

func FindDNSServers(client *ssh.Client) ([]string, error)

func Fuzzy

func Fuzzy(client *sftp.Client, wd string, l *zap.SugaredLogger) ([]string, error)

func FuzzyLocal

func FuzzyLocal(wd string, l *zap.SugaredLogger) ([]string, error)

func FuzzyRemote

func FuzzyRemote(client *sftp.Client, wd string, l *zap.SugaredLogger) ([]string, error)

func Glob

func Glob(wd, pattern string, readDir readDirNamesFunc, lstat lStatFunc) (matches []string, err error)

func HasMeta

func HasMeta(path string) bool

func LocalGlob

func LocalGlob(wd, pattern string) ([]string, error)

func SFTPGlob

func SFTPGlob(wd string, client *sftp.Client, pattern string) ([]string, error)

func Walk

func Walk(client *sftp.Client, wd string, cb ListCallback, l *zap.SugaredLogger) error

func WalkLocal

func WalkLocal(wd string, cb ListCallback, l *zap.SugaredLogger) error

func WalkRemote

func WalkRemote(client *sftp.Client, wd string, cb ListCallback, l *zap.SugaredLogger) error

Types

type CPUInfo

type CPUInfo struct {
	User    float32
	Nice    float32
	System  float32
	Idle    float32
	Iowait  float32
	Irq     float32
	SoftIrq float32
	Steal   float32
	Guest   float32
}

type CachedResult

type CachedResult struct {
	IP net.IP
	// contains filtered or unexported fields
}

func (CachedResult) Time

func (res CachedResult) Time() time.Time

type ErrResolve

type ErrResolve struct {
	Err error
	// contains filtered or unexported fields
}

func (ErrResolve) Error

func (e ErrResolve) Error() string

func (ErrResolve) Time

func (e ErrResolve) Time() time.Time

type FSInfo

type FSInfo struct {
	MountPoint string
	Used       uint64
	Free       uint64
}

func (FSInfo) Total

func (fs FSInfo) Total() uint64

type LinuxStater

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

func (*LinuxStater) Get

func (s *LinuxStater) Get(ctx context.Context) (Stats, error)

type ListCallback

type ListCallback func(path, relName string, isDir bool) error

type LoadInfo

type LoadInfo struct {
	Load1        string
	Load5        string
	Load10       string
	RunningProcs string
	TotalProcs   string
}

type MemInfo

type MemInfo struct {
	MemTotal  uint64
	MemActive uint64
	SwapTotal uint64
	SwapFree  uint64
}

type Merror

type Merror struct {
	Uptime   error
	Hostname error
	Load     error
	Mem      error
	FS       error
	Net      error
	CPU      error
}

func (*Merror) Error

func (e *Merror) Error() string

func (*Merror) IsCanceled

func (e *Merror) IsCanceled() bool

func (*Merror) IsZero

func (e *Merror) IsZero() bool

type NetInfo

type NetInfo struct {
	Name string
	IPv4 []string
	IPv6 []string
	Rx   uint64
	Tx   uint64
}

type OpenBSDStater

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

func (*OpenBSDStater) Get

func (s *OpenBSDStater) Get(ctx context.Context) (Stats, error)

type Resolver

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

func NewResolver

func NewResolver(client *ssh.Client, serverAddr string, logger *zap.SugaredLogger) *Resolver

func (Resolver) Resolve

func (r Resolver) Resolve(ctx context.Context, name string) (context.Context, net.IP, error)

type Stater

type Stater interface {
	Get(context.Context) (Stats, error)
}

func NewStater

func NewStater(client *ssh.Client) (Stater, error)

type Stats

type Stats struct {
	Uptime   time.Duration
	Hostname string
	Load     LoadInfo
	Mem      MemInfo
	FS       []FSInfo
	Net      []NetInfo
	CPU      CPUInfo // or []CPUInfo to get all the cpu-core's stats?
}

Jump to

Keyboard shortcuts

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