Documentation ¶
Index ¶
- Constants
- func CreateDirectoryIfNotExists(path string) (string, error)
- func EnableAgentMode(p *string)
- func ExecuteCmd(in string) (out []byte, err error)
- func Ping(in string) (out string)
- func RandomString(n int) string
- func RandomStringWithTime(n int, prefix string) string
- func SetupPrefix(p *string)
- func VerifyPasscode(p string) (ok bool)
- type Conf
- type Dir
- type Entity
- type File
- type MultiEntity
- type Tar
Constants ¶
const ( // ConfPath - default configuration loaction ConfPath string = "conf" )
Variables ¶
This section is empty.
Functions ¶
func CreateDirectoryIfNotExists ¶
CreateDirectoryIfNotExists helps to create a dir if not exists and returns the dir path
func EnableAgentMode ¶
func EnableAgentMode(p *string)
EnableAgentMode - basic setup for agent to run
func ExecuteCmd ¶
ExecuteCmd - helps to execute cmd at os level
func RandomString ¶
RandomString helps to generate random charactor with n length
func RandomStringWithTime ¶
RandomStringWithTime helps to generate random charactor with n length with time suffix
func SetupPrefix ¶ added in v0.1.4
func SetupPrefix(p *string)
SetupPrefix - basic setup for agent to run
func VerifyPasscode ¶ added in v0.1.3
VerifyPasscode helps to validate the agent passcode
Types ¶
type Conf ¶
Conf help to deal with configuration default
var C Conf
C contains all system level configurations
type Dir ¶
type Dir interface { Entity Clean() error CreateFile(string, []byte) error CreateAndWriteFile(string, bytes.Buffer) (int64, error) Remove(string) error RemoveFile(string) error Scan() ([]File, error) Copy(to string) error }
Dir declares the directory
type File ¶
type File interface { Entity SPath() string RPath() string IsSameFileAt(Entity, bool) (bool, error) Copy(Entity) error }
File declares the directory
type MultiEntity ¶
type MultiEntity []Entity
MultiEntity - new type for sorting purpose
func (MultiEntity) Less ¶
func (f MultiEntity) Less(i, j int) bool
Less is part of sort.Interface. We use count as the value to sort by