Documentation ¶
Index ¶
- Constants
- Variables
- func AtLeastVersion(v1, v2 string) (bool, error)
- func Bytes(bytes uint64) string
- func Duration(s float64) string
- func FileExists(file string) bool
- func FileSize(fileName string) (int64, error)
- func MakeDir(dir string) error
- func MakeStartLock() error
- func Mbps(bytes uint64, seconds float64) string
- func Ping(apiURL string) (int, error)
- func RemoveFile(file string) error
- func SameFile(file1, file2 string) (bool, error)
- func TimeString(t time.Time) string
- func TimeoutDialer(config *TimeoutClientConfig) func(net, addr string) (c net.Conn, err error)
- func ToBool(s string) bool
- func URL(hostname string, paths ...string) string
- type API
- func (a *API) AgentLink(resource string) string
- func (a *API) AgentUuid() string
- func (a *API) Connect(hostname, basePath, agentUuid string) error
- func (a *API) CreateInstance(url string, in interface{}) (bool, error)
- func (a *API) EntryLink(resource string) string
- func (a *API) Get(url string) (int, []byte, error)
- func (a *API) GetConnectionConfig() ConnectionConfig
- func (a *API) Hostname() string
- func (a *API) Init(hostname string) (int, error)
- func (a *API) Origin() string
- func (a *API) Post(url string, data []byte) (*http.Response, []byte, error)
- func (a *API) Put(url string, data []byte) (*http.Response, []byte, error)
- func (a *API) URL(paths ...string) string
- type APIConnector
- type Backoff
- type CmdRejectedError
- type CmdTimeoutError
- type ConnectionConfig
- type InvalidInstanceError
- 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 QueueFullError
- type ServiceIsNotRunningError
- type ServiceIsRunningError
- type ServiceManager
- type Status
- type StatusReporter
- type SyncChan
- type TimeoutClientConfig
- type UnknownCmdError
- type UnknownServiceError
- type WebsocketClient
Constants ¶
View Source
const ( DEFAULT_BASEDIR = "/usr/local/percona/qan-agent" CONFIG_FILE_SUFFIX = ".conf" INSTANCE_FILE_SUFFIX = ".json" // Relative to Basedir.path: CONFIG_DIR = "config" INSTANCE_DIR = "instance" DATA_DIR = "data" BIN_DIR = "bin" TRASH_DIR = "trash" START_LOCK = "start.lock" START_SCRIPT = "start.sh" )
Variables ¶
View Source
var Basedir basedir
View Source
var ErrNoSystemTree error = errors.New("No local system tree file")
Functions ¶
func AtLeastVersion ¶
func FileExists ¶
func MakeStartLock ¶
func MakeStartLock() error
func RemoveFile ¶
func TimeString ¶
func TimeoutDialer ¶
func TimeoutDialer(config *TimeoutClientConfig) func(net, addr string) (c net.Conn, err error)
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) GetConnectionConfig ¶ added in v1.5.0
func (a *API) GetConnectionConfig() ConnectionConfig
type APIConnector ¶
type APIConnector interface { Connect(hostname, basePath, agentUuid string) error Init(hostname string) (code int, err error) Get(url string) (int, []byte, error) Post(url string, data []byte) (*http.Response, []byte, error) Put(url string, data []byte) (*http.Response, []byte, error) CreateInstance(url string, it interface{}) (bool, error) EntryLink(resource string) string AgentLink(resource string) string Origin() string Hostname() string AgentUuid() string URL(paths ...string) string GetConnectionConfig() ConnectionConfig }
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 ConnectionConfig ¶ added in v1.5.0
type InvalidInstanceError ¶
type InvalidInstanceError struct {
UUID string
}
func (InvalidInstanceError) Error ¶
func (e InvalidInstanceError) Error() string
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) DebugOffline ¶
func (l *Logger) DebugOffline(entry ...interface{})
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 WebsocketClient ¶
type WebsocketClient interface { Conn() *websocket.Conn Status() map[string]string // Cmd/Reply chans: Start() // start the send/recv chans Stop() // stop the send/recv chans manually RecvChan() chan *proto.Cmd // get the (recv) cmdChan SendChan() chan *proto.Reply // get the (send) replyChan // Async connect: Connect() // try forever to connect, notify via ConnectChan Disconnect() error // disconnect manually, notify via ConnectChan ConnectChan() chan bool // true on connect, false on disconnect ErrorChan() chan error // get err from send/recv chans // Sync connect: ConnectOnce(timeout uint) error DisconnectOnce() error // Data transfer: SendBytes(data []byte, timeout uint) error // send data (data/sender) Recv(data interface{}, timeout uint) error // recv proto.Response (data/sender) Send(data interface{}, timeout uint) error // send proto.LogEntry (log/relay) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.