Versions in this module Expand all Collapse all v1 v1.0.13 May 15, 2015 Changes in this version + func AtLeastVersion(v1, v2 string) (bool, error) v1.0.12 Apr 8, 2015 Changes in this version type API + func (a *API) Init(hostname string, apiKey string, headers map[string]string) (int, error) + func (a *API) URL(paths ...string) string type APIConnector + Init func(hostname, apiKey string, headers map[string]string) (code int, err error) + URL func(paths ...string) string v1.0.11 Feb 24, 2015 v1.0.10 Dec 30, 2014 Changes in this version + func Bytes(bytes uint64) string + func Duration(s float64) string + func Mbps(bytes uint64, seconds float64) string + func TimeString(t time.Time) string v1.0.9 Oct 22, 2014 v1.0.8 Sep 18, 2014 v1.0.7 Sep 5, 2014 Changes in this version + const START_LOCK + const START_SCRIPT + const TRASH_DIR type WebsocketClient + DisconnectOnce func() v1.0.6 Aug 13, 2014 v1.0.5 Jul 28, 2014 v1.0.4 Jul 9, 2014 v1.0.3 Jun 5, 2014 v1.0.2 May 27, 2014 v1.0.1 May 16, 2014 v1.0.0 May 10, 2014 Changes in this version + const BIN_DIR + const CONFIG_DIR + const CONFIG_FILE_SUFFIX + const DATA_DIR + const DEFAULT_BASEDIR + const START_LOCK_FILE + var Basedir basedir + var PublicKey = []byte(...) + func FileExists(file string) bool + func FileSize(fileName string) (int64, error) + func MakeDir(dir string) error + func MakeStartLock() error + func Ping(hostname, apiKey string) (int, error) + func RemoveFile(file string) error + func SameFile(file1, file2 string) (bool, error) + func TimeoutDialer(config *TimeoutClientConfig) func(net, addr string) (c net.Conn, err error) + func URL(hostname string, paths ...string) string + func VersionStringToInts(version string) (int64, int64, int64) + func WaitStartLock() error + type API struct + func NewAPI() *API + func (a *API) AgentLink(resource string) string + func (a *API) AgentUuid() string + func (a *API) ApiKey() string + func (a *API) Connect(hostname, apiKey, agentUuid string) error + func (a *API) EntryLink(resource string) string + func (a *API) Get(apiKey, url string) (int, []byte, error) + func (a *API) Hostname() string + func (a *API) Origin() string + func (a *API) Post(apiKey, url string, data []byte) (*http.Response, []byte, error) + func (a *API) Put(apiKey, url string, data []byte) (*http.Response, []byte, error) + type APIConnector interface + AgentLink func(resource string) string + AgentUuid func() string + ApiKey func() string + Connect func(hostname, apiKey, agentUuid string) error + EntryLink func(resource string) string + Get func(apiKey, url string) (int, []byte, error) + Hostname func() string + Origin func() string + Post func(apiKey, url string, data []byte) (*http.Response, []byte, error) + Put func(apiKey, url string, data []byte) (*http.Response, []byte, error) + type Backoff struct + NowFunc func() time.Time + func NewBackoff(resetAfter time.Duration) *Backoff + func (b *Backoff) Success() + func (b *Backoff) Wait() time.Duration + type CmdRejectedError struct + Cmd string + Reason string + func (e CmdRejectedError) Error() string + type CmdTimeoutError struct + Cmd string + func (e CmdTimeoutError) Error() string + type DuplicateServiceInstanceError struct + Id uint + Service string + func (e DuplicateServiceInstanceError) Error() string + type InvalidServiceInstanceError struct + Id uint + Service string + func (e InvalidServiceInstanceError) Error() string + type Logger struct + func NewLogger(logChan chan *proto.LogEntry, service string) *Logger + func (l *Logger) Debug(entry ...interface{}) + func (l *Logger) DebugOffline(entry ...interface{}) + func (l *Logger) Error(entry ...interface{}) + func (l *Logger) Fatal(entry ...interface{}) + func (l *Logger) Info(entry ...interface{}) + func (l *Logger) LogChan() chan *proto.LogEntry + func (l *Logger) Service() string + func (l *Logger) Warn(entry ...interface{}) + type PidFile struct + func NewPidFile() *PidFile + func (p *PidFile) Get() string + func (p *PidFile) Remove() error + func (p *PidFile) Set(pidFile string) error + type QueueFullError struct + Cmd string + Name string + Size uint + func (e QueueFullError) Error() string + type ServiceIsNotRunningError struct + Service string + func (e ServiceIsNotRunningError) Error() string + type ServiceIsRunningError struct + Service string + func (e ServiceIsRunningError) Error() string + type ServiceManager interface + GetConfig func() ([]proto.AgentConfig, []error) + Handle func(cmd *proto.Cmd) *proto.Reply + Start func() error + Status func() map[string]string + Stop func() error + type Status struct + func NewStatus(procs []string) *Status + func (s *Status) All() map[string]string + func (s *Status) Get(proc string) string + func (s *Status) Merge(others ...map[string]string) map[string]string + func (s *Status) Update(proc string, status string) + func (s *Status) UpdateRe(proc string, status string, cmd *proto.Cmd) + type StatusReporter interface + Status func() map[string]string + type SyncChan struct + Crash bool + CrashChan chan bool + DoneChan chan bool + StartChan chan bool + StopChan chan bool + func NewSyncChan() *SyncChan + func (sync *SyncChan) Done() + func (sync *SyncChan) Graceful() + func (sync *SyncChan) IsGraceful() bool + func (sync *SyncChan) Start() bool + func (sync *SyncChan) Stop() + func (sync *SyncChan) Wait() + type TimeoutClientConfig struct + ConnectTimeout time.Duration + ReadWriteTimeout time.Duration + type UnknownCmdError struct + Cmd string + func (e UnknownCmdError) Error() string + type UnknownServiceError struct + Service string + func (e UnknownServiceError) Error() string + type UnknownServiceInstanceError struct + Id uint + Service string + func (e UnknownServiceInstanceError) Error() string + type Updater struct + func NewUpdater(logger *Logger, api APIConnector, pubKey []byte, ...) *Updater + func (u *Updater) Check() (string, string, error) + func (u *Updater) Update(version string) error + type WebsocketClient interface + Conn func() *websocket.Conn + Connect func() + ConnectChan func() chan bool + ConnectOnce func() error + Disconnect func() error + ErrorChan func() chan error + Recv func(data interface{}, timeout uint) error + RecvChan func() chan *proto.Cmd + Send func(data interface{}, timeout uint) error + SendBytes func(data []byte) error + SendChan func() chan *proto.Reply + Start func() + Status func() map[string]string + Stop func()