Documentation
¶
Index ¶
- Constants
- Variables
- 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
- 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
- type Backoff
- type CmdRejectedError
- type CmdTimeoutError
- type DuplicateServiceInstanceError
- type InvalidServiceInstanceError
- type 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
- type QueueFullError
- type ServiceIsNotRunningError
- type ServiceIsRunningError
- type ServiceManager
- type Status
- type StatusReporter
- type SyncChan
- type TimeoutClientConfig
- type UnknownCmdError
- type UnknownServiceError
- type UnknownServiceInstanceError
- type Updater
- type WebsocketClient
Constants ¶
View Source
const ( DEFAULT_BASEDIR = "/usr/local/percona/percona-agent" CONFIG_FILE_SUFFIX = ".conf" // Relative to Basedir.path: CONFIG_DIR = "config" DATA_DIR = "data" BIN_DIR = "bin" START_LOCK_FILE = "start.lock" )
Variables ¶
View Source
var Basedir basedir
View Source
var PublicKey = []byte(`-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA3Ks0r5mrqcxOj95VLyCC
JGkilUyyqIwK9YANtf1qOghQHM4qR1g22c+4iLalzcKuf7fRFWyEOmthUMJEdaPN
k3bHTvqBOVsKigq1Yjydlrk3uIvCBLA37HbHKqM7Uq3vPG25GGxv3wI6NbS1fJOO
VnX0gUYTEiQrbv5OjSBBX/A1mj2RBbSVmHbRSwogFGrxEcz+cn8ulDp+8BOtUHmj
/4FY4IXjeLHihBv/q4TQrO3m0CSig3hmfPJiGpWFdxO5dldb8HN1L+P2EsI6xSxo
5Rk48UbIRBgZjZKQcRCacM0V4Co+HxmtXQkrNIf7jdX6iYXPUD/c8+k7rM1eLgEQ
5jNKQEAiLBdB8ZhDtA4MgFHu8ygwEdYtydo0zLqU0EmtpdmUqnVidudaqVFSiC2Q
KAlH5+r/arnC47cwxa4XletbFzEUcw8sC8ZeqWRSC4EGBJI3fgxoikXsarDQ+uoo
9Hy7jB6XbSGgOJE8Spw3q39DQsB2l7sBliEvi5cl1svRMwrNrTd4A2juAze/GQ+B
tqLJb/FMM1F7LaCl8nLDTf1jPav1/BN5u2y893gX8e48MyUaDtzdiT5HMzMaGkIc
IaY4e/7W5A+S1qCWV0AXTawBgcorRCnUucIjrq6canVZj7BdZpADysRzMib8fS8O
3ca1+bu7FtdcwOTpZusdRfUCAwEAAQ==
-----END PUBLIC KEY-----`)
Functions ¶
func FileExists ¶
func MakeStartLock ¶
func MakeStartLock() error
func RemoveFile ¶
func TimeoutDialer ¶
func TimeoutDialer(config *TimeoutClientConfig) func(net, addr string) (c net.Conn, err error)
func WaitStartLock ¶
func WaitStartLock() error
Types ¶
type APIConnector ¶
type APIConnector interface {
Connect(hostname, apiKey, agentUuid string) error
Get(apiKey, url string) (int, []byte, error)
Post(apiKey, url string, data []byte) (*http.Response, []byte, error)
Put(apiKey, url string, data []byte) (*http.Response, []byte, error)
EntryLink(resource string) string
AgentLink(resource string) string
Origin() string
Hostname() string
ApiKey() string
AgentUuid() string
}
type Backoff ¶
func NewBackoff ¶
type CmdRejectedError ¶
func (CmdRejectedError) Error ¶
func (e CmdRejectedError) Error() string
type CmdTimeoutError ¶
type CmdTimeoutError struct {
Cmd string
}
func (CmdTimeoutError) Error ¶
func (e CmdTimeoutError) Error() string
type DuplicateServiceInstanceError ¶
func (DuplicateServiceInstanceError) Error ¶
func (e DuplicateServiceInstanceError) Error() string
type InvalidServiceInstanceError ¶
func (InvalidServiceInstanceError) Error ¶
func (e InvalidServiceInstanceError) Error() string
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) DebugOffline ¶
func (l *Logger) DebugOffline(entry ...interface{})
type PidFile ¶
type PidFile struct {
// contains filtered or unexported fields
}
func NewPidFile ¶
func NewPidFile() *PidFile
type QueueFullError ¶
func (QueueFullError) Error ¶
func (e QueueFullError) Error() string
type ServiceIsNotRunningError ¶
type ServiceIsNotRunningError struct {
Service string
}
func (ServiceIsNotRunningError) Error ¶
func (e ServiceIsNotRunningError) Error() string
type ServiceIsRunningError ¶
type ServiceIsRunningError struct {
Service string
}
func (ServiceIsRunningError) Error ¶
func (e ServiceIsRunningError) Error() string
type ServiceManager ¶
type StatusReporter ¶
type SyncChan ¶
type SyncChan struct {
StartChan chan bool
StopChan chan bool
DoneChan chan bool
CrashChan chan bool
Crash bool
}
func NewSyncChan ¶
func NewSyncChan() *SyncChan
func (*SyncChan) IsGraceful ¶
type TimeoutClientConfig ¶
type UnknownCmdError ¶
type UnknownCmdError struct {
Cmd string
}
func (UnknownCmdError) Error ¶
func (e UnknownCmdError) Error() string
type UnknownServiceError ¶
type UnknownServiceError struct {
Service string
}
func (UnknownServiceError) Error ¶
func (e UnknownServiceError) Error() string
type UnknownServiceInstanceError ¶
func (UnknownServiceInstanceError) Error ¶
func (e UnknownServiceInstanceError) Error() string
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
func NewUpdater ¶
func NewUpdater(logger *Logger, api APIConnector, pubKey []byte, currentBin, currentVersion string) *Updater
type WebsocketClient ¶
type WebsocketClient interface {
Connect()
ConnectOnce() error
Disconnect() error
Status() map[string]string
// Channel interface:
Start()
Stop()
SendChan() chan *proto.Reply
RecvChan() chan *proto.Cmd
ConnectChan() chan bool
ErrorChan() chan error
// Direct interface:
SendBytes(data []byte) error
Send(data interface{}, timeout uint) error
Recv(data interface{}, timeout uint) error
Conn() *websocket.Conn
}
Click to show internal directories.
Click to hide internal directories.