common

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultServerAddr       = "localhost:2220"
	DefaultServerPublicAddr = ":2220"
	DefaultApAddr           = "localhost:2221"
	DefaultClientAddr       = "localhost:2222"
)
View Source
const SrvcSSH = "ssh"

Variables

View Source
var CurrentUser *user.User

Functions

func Digest added in v0.1.5

func Digest(pth string) (v string, err error)

func Environ added in v0.1.5

func Environ() (env []string)

func GetKeyFile

func GetKeyFile(path ...string) string

func RemoveEmptyDir

func RemoveEmptyDir(rootDir, pth string) (err error)

func TimeToString added in v0.1.11

func TimeToString(t time.Time) (s string)

Types

type ApUpgradePayload added in v0.1.5

type ApUpgradePayload struct {
	Ap      string  `yaml:"Ap"`
	ApAddr  string  `yaml:"ApAddr"`
	Version Version `yaml:"Version"`
}

func (*ApUpgradePayload) FPrint added in v0.1.5

func (up *ApUpgradePayload) FPrint(w io.Writer) (err error)

func (*ApUpgradePayload) FRead added in v0.1.5

func (up *ApUpgradePayload) FRead(r io.Reader) (err error)

func (ApUpgradePayload) String added in v0.1.5

func (up ApUpgradePayload) String() string

type Copier

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

func NewCopier

func NewCopier(name string, w io.Writer, r io.Reader, closers ...func() error) *Copier

func (*Copier) Close added in v0.1.11

func (cp *Copier) Close() error

func (Copier) Copy

func (cp Copier) Copy() error

func (Copier) String

func (cp Copier) String() string

type Delayer

type Delayer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewDelayer

func NewDelayer(duration time.Duration) *Delayer

func (Delayer) Close

func (d Delayer) Close() error

func (*Delayer) Duration

func (d *Delayer) Duration() time.Duration

func (*Delayer) SetDuration

func (d *Delayer) SetDuration(duration time.Duration)

func (*Delayer) Wait

func (d *Delayer) Wait()

type IOSync added in v0.1.11

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

func NewIOSync added in v0.1.11

func NewIOSync(copiers ...*Copier) (s *IOSync)

func (*IOSync) Sync added in v0.1.11

func (s *IOSync) Sync()

type UpgradePayload added in v0.1.5

type UpgradePayload struct {
	Ok         bool
	Changed    bool
	Stream     bool
	StreamSize int64
	URL        string
	Err        error
}

func (*UpgradePayload) ErrorF added in v0.1.5

func (up *UpgradePayload) ErrorF(w io.Writer, msg interface{}) (rerr error)

func (*UpgradePayload) Read added in v0.1.5

func (up *UpgradePayload) Read(in io.Reader) (r io.Reader, err error)

func (*UpgradePayload) Write added in v0.1.5

func (up *UpgradePayload) Write(w io.Writer) (err error)

type Version added in v0.1.5

type Version struct {
	Version   string    `yaml:"Version"`
	Commit    string    `yaml:"Commit"`
	BuildDate time.Time `yaml:"Build Date"`
	OS        string    `yaml:"OS"`
	Arch      string    `yaml:"Arch"`
	Arm       uint8     `yaml:"Arm"`
	Digest    string    `yaml:"Digest"`
}

func (*Version) FPrint added in v0.1.5

func (v *Version) FPrint(w io.Writer) (err error)

func (*Version) FRead added in v0.1.5

func (v *Version) FRead(r io.Reader) (err error)

func (*Version) Marshal added in v0.1.5

func (v *Version) Marshal() []byte

func (*Version) ToString added in v0.1.5

func (v *Version) ToString() string

func (*Version) Unmarshal added in v0.1.5

func (v *Version) Unmarshal(b []byte) *Version

Jump to

Keyboard shortcuts

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