Documentation ¶
Index ¶
- Variables
- func NewClients() *clients
- func PingAPI(hostname string) (bool, *http.Response)
- type API
- func (a *API) AgentLink(resource string) string
- func (a *API) AgentUuid() string
- func (a *API) Conn() *websocket.Conn
- func (a *API) Connect(hostname, basePath, agentUuid string) error
- func (a *API) ConnectChan() chan bool
- func (a *API) ConnectOnce(timeout uint) error
- func (a *API) CreateInstance(url string, it interface{}) (bool, error)
- func (a *API) Disconnect() error
- func (a *API) DisconnectOnce() error
- func (a *API) EntryLink(resource string) string
- func (a *API) ErrorChan() chan error
- func (a *API) Get(url string) (int, []byte, error)
- func (a *API) GetConnectionConfig() pct.ConnectionConfig
- func (a *API) Hostname() string
- func (a *API) Init(hostname string, headers map[string]string) (code int, err 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) Recv(data interface{}, timeout uint) error
- func (a *API) RecvChan() chan *proto.Cmd
- func (a *API) Send(data interface{}, timeout uint) error
- func (a *API) SendBytes(data []byte, timeout uint) error
- func (a *API) SendChan() chan *proto.Reply
- func (a *API) Start()
- func (a *API) Status() map[string]string
- func (a *API) Stop()
- func (a *API) URL(paths ...string) string
- type APIResponse
- type AnalyzerArgs
- type Clock
- type CmdFactory
- type ConnectionFactory
- type DataClient
- func (c *DataClient) Conn() *websocket.Conn
- func (c *DataClient) Connect()
- func (c *DataClient) ConnectChan() chan bool
- func (c *DataClient) ConnectOnce(timeout uint) error
- func (c *DataClient) Disconnect() error
- func (c *DataClient) DisconnectOnce() error
- func (c *DataClient) ErrorChan() chan error
- func (c *DataClient) Recv(resp interface{}, timeout uint) error
- func (c *DataClient) RecvChan() chan *proto.Cmd
- func (c *DataClient) Send(data interface{}, timeout uint) error
- func (c *DataClient) SendBytes(data []byte, timeout uint) error
- func (c *DataClient) SendChan() chan *proto.Reply
- func (c *DataClient) SetConnectChan(connectChan chan bool)
- func (c *DataClient) Start()
- func (c *DataClient) Status() map[string]string
- func (c *DataClient) Stop()
- type LogParser
- type MockCmd
- type MockServiceManager
- func (m *MockServiceManager) GetConfig() ([]proto.AgentConfig, []error)
- func (m *MockServiceManager) GetDefaults(uuid string) map[string]interface{}
- func (m *MockServiceManager) Handle(cmd *proto.Cmd) *proto.Reply
- func (m *MockServiceManager) IsRunning() bool
- func (m *MockServiceManager) Reset()
- func (m *MockServiceManager) Start() error
- func (m *MockServiceManager) Status() map[string]string
- func (m *MockServiceManager) Stop() error
- type MrmsMonitor
- func (m *MrmsMonitor) Add(in proto.Instance) chan proto.Instance
- func (m *MrmsMonitor) Check()
- func (m *MrmsMonitor) ListenerCount(uuid string) uint
- func (m *MrmsMonitor) Remove(uuid string, c chan proto.Instance)
- func (m *MrmsMonitor) SimulateMySQLRestart()
- func (m *MrmsMonitor) Start(interval time.Duration) error
- func (m *MrmsMonitor) Status() (status map[string]string)
- func (m *MrmsMonitor) Stop() error
- type NullClient
- func (c *NullClient) Conn() *websocket.Conn
- func (c *NullClient) Connect()
- func (c *NullClient) ConnectChan() chan bool
- func (c *NullClient) ConnectOnce() error
- func (c *NullClient) Disconnect() error
- func (c *NullClient) ErrorChan() chan error
- func (c *NullClient) Recv(data interface{}, timeout uint) error
- func (c *NullClient) RecvChan() chan *proto.Cmd
- func (c *NullClient) Send(data interface{}, timeout uint) error
- func (c *NullClient) SendBytes(data []byte, timeout uint) error
- func (c *NullClient) SendChan() chan *proto.Reply
- func (c *NullClient) Start()
- func (c *NullClient) Stop()
- type NullMySQL
- func (n *NullMySQL) AtLeastVersion(v string) (bool, error)
- func (n *NullMySQL) Close()
- func (n *NullMySQL) Connect() error
- func (n *NullMySQL) DB() *sql.DB
- func (n *NullMySQL) DSN() string
- func (n *NullMySQL) Exec(queries []string) error
- func (n *NullMySQL) Explain(db, query string, convert bool) (*proto.ExplainResult, error)
- func (n *NullMySQL) GetExec() []string
- func (n *NullMySQL) GetGlobalVarBoolean(varName string) (varValue sql.NullBool, err error)
- func (n *NullMySQL) GetGlobalVarInteger(varName string) (varValue sql.NullInt64, err error)
- func (n *NullMySQL) GetGlobalVarNumeric(varName string) (varValue sql.NullFloat64, err error)
- func (n *NullMySQL) GetGlobalVarString(varName string) (varValue sql.NullString, err error)
- func (n *NullMySQL) GetSet() []mysql.Query
- func (n *NullMySQL) GetUptimeCount() uint
- func (n *NullMySQL) Reset()
- func (n *NullMySQL) Set(queries []mysql.Query) error
- func (n *NullMySQL) SetAtLeastVersion(atLeastVersion bool, err error)
- func (n *NullMySQL) SetGlobalVarInteger(name string, value int64)
- func (n *NullMySQL) SetGlobalVarNumeric(name string, value float64)
- func (n *NullMySQL) SetGlobalVarString(name, value string)
- func (n *NullMySQL) SetUptime(uptime int64)
- func (n *NullMySQL) TableInfo(tables *proto.TableInfoQuery) (proto.TableInfoResult, error)
- func (n *NullMySQL) UTCOffset() (time.Duration, time.Duration, error)
- func (n *NullMySQL) Uptime() (int64, error)
- func (n *NullMySQL) VersionConstraint(constraint string) (bool, error)
- type QanAnalyzer
- func (a *QanAnalyzer) Config() pc.QAN
- func (a *QanAnalyzer) GetDefaults(uuid string) map[string]interface{}
- func (a *QanAnalyzer) SetConfig(config pc.QAN)
- func (a *QanAnalyzer) Start() error
- func (a *QanAnalyzer) Status() map[string]string
- func (a *QanAnalyzer) Stop() error
- func (a *QanAnalyzer) String() string
- func (a *QanAnalyzer) ValidateConfig(config pc.QAN) (pc.QAN, error)
- type QanAnalyzerFactory
- type Spooler
- func (s *Spooler) CancelFiles()
- func (s *Spooler) Files() <-chan string
- func (s *Spooler) Read(file string) ([]byte, error)
- func (s *Spooler) Reject(file string) error
- func (s *Spooler) Remove(file string) error
- func (s *Spooler) Reset()
- func (s *Spooler) Start(sz proto.Serializer) error
- func (s *Spooler) Status() map[string]string
- func (s *Spooler) Stop() error
- func (s *Spooler) Write(service string, data interface{}) error
- type Ticker
- type TickerFactory
- type WebsocketClient
- func (c *WebsocketClient) Conn() *websocket.Conn
- func (c *WebsocketClient) Connect()
- func (c *WebsocketClient) ConnectChan() chan bool
- func (c *WebsocketClient) ConnectOnce(timeout uint) error
- func (c *WebsocketClient) Disconnect() error
- func (c *WebsocketClient) DisconnectOnce() error
- func (c *WebsocketClient) ErrorChan() chan error
- func (c *WebsocketClient) Recv(data interface{}, timeout uint) error
- func (c *WebsocketClient) RecvChan() chan *proto.Cmd
- func (c *WebsocketClient) Send(data interface{}, timeout uint) error
- func (c *WebsocketClient) SendBytes(data []byte, timeout uint) error
- func (c *WebsocketClient) SendChan() chan *proto.Reply
- func (c *WebsocketClient) SetConnectChan(connectChan chan bool)
- func (c *WebsocketClient) Start()
- func (c *WebsocketClient) Status() map[string]string
- func (c *WebsocketClient) Stop()
- type WebsocketServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ERR_NOT_FOUND = errors.New("var not found in NullMySQL mock")
Functions ¶
func NewClients ¶ added in v1.5.0
func NewClients() *clients
Types ¶
type API ¶
type API struct { GetCode []int GetData [][]byte GetError []error GetResp []APIResponse PutResp []APIResponse // contains filtered or unexported fields }
func (*API) ConnectChan ¶ added in v1.5.0
func (*API) ConnectOnce ¶ added in v1.5.0
func (*API) Disconnect ¶ added in v1.5.0
func (*API) DisconnectOnce ¶ added in v1.5.0
func (*API) GetConnectionConfig ¶ added in v1.5.0
func (a *API) GetConnectionConfig() pct.ConnectionConfig
type APIResponse ¶
type AnalyzerArgs ¶
type CmdFactory ¶
type CmdFactory struct {
Cmds []*MockCmd
}
type ConnectionFactory ¶
type DataClient ¶
type DataClient struct { // -- ErrChan chan error RecvError chan error ConnectError error TraceChan chan string // contains filtered or unexported fields }
func NewDataClient ¶
func NewDataClient(dataChan chan []byte, respChan chan interface{}) *DataClient
func (*DataClient) Conn ¶
func (c *DataClient) Conn() *websocket.Conn
func (*DataClient) Connect ¶
func (c *DataClient) Connect()
func (*DataClient) ConnectChan ¶
func (c *DataClient) ConnectChan() chan bool
func (*DataClient) ConnectOnce ¶
func (c *DataClient) ConnectOnce(timeout uint) error
func (*DataClient) Disconnect ¶
func (c *DataClient) Disconnect() error
func (*DataClient) DisconnectOnce ¶
func (c *DataClient) DisconnectOnce() error
func (*DataClient) ErrorChan ¶
func (c *DataClient) ErrorChan() chan error
func (*DataClient) Recv ¶
func (c *DataClient) Recv(resp interface{}, timeout uint) error
Second, agent calls this to recv response from API to previous send.
func (*DataClient) RecvChan ¶
func (c *DataClient) RecvChan() chan *proto.Cmd
func (*DataClient) Send ¶
func (c *DataClient) Send(data interface{}, timeout uint) error
func (*DataClient) SendBytes ¶
func (c *DataClient) SendBytes(data []byte, timeout uint) error
First, agent calls this to send encoded proto.Data to API.
func (*DataClient) SendChan ¶
func (c *DataClient) SendChan() chan *proto.Reply
func (*DataClient) SetConnectChan ¶
func (c *DataClient) SetConnectChan(connectChan chan bool)
func (*DataClient) Start ¶
func (c *DataClient) Start()
func (*DataClient) Status ¶
func (c *DataClient) Status() map[string]string
func (*DataClient) Stop ¶
func (c *DataClient) Stop()
type LogParser ¶
type LogParser struct {
// contains filtered or unexported fields
}
func NewLogParser ¶
func NewLogParser() *LogParser
type MockCmd ¶
func NewMockCmd ¶
type MockServiceManager ¶
type MockServiceManager struct { StartErr error StopErr error IsRunningVal bool Cmds []*proto.Cmd // contains filtered or unexported fields }
func NewMockServiceManager ¶
func NewMockServiceManager( name string, startWaitGroup *sync.WaitGroup, traceChan chan string, ) *MockServiceManager
func (*MockServiceManager) GetConfig ¶
func (m *MockServiceManager) GetConfig() ([]proto.AgentConfig, []error)
func (*MockServiceManager) GetDefaults ¶ added in v1.5.0
func (m *MockServiceManager) GetDefaults(uuid string) map[string]interface{}
func (*MockServiceManager) Handle ¶
func (m *MockServiceManager) Handle(cmd *proto.Cmd) *proto.Reply
func (*MockServiceManager) IsRunning ¶
func (m *MockServiceManager) IsRunning() bool
func (*MockServiceManager) Reset ¶
func (m *MockServiceManager) Reset()
func (*MockServiceManager) Start ¶
func (m *MockServiceManager) Start() error
func (*MockServiceManager) Status ¶
func (m *MockServiceManager) Status() map[string]string
func (*MockServiceManager) Stop ¶
func (m *MockServiceManager) Stop() error
type MrmsMonitor ¶
type MrmsMonitor struct {
// contains filtered or unexported fields
}
func NewMrmsMonitor ¶
func NewMrmsMonitor() *MrmsMonitor
func (*MrmsMonitor) Check ¶
func (m *MrmsMonitor) Check()
func (*MrmsMonitor) ListenerCount ¶
func (m *MrmsMonitor) ListenerCount(uuid string) uint
func (*MrmsMonitor) SimulateMySQLRestart ¶
func (m *MrmsMonitor) SimulateMySQLRestart()
The restartChan in the real MrmsMonitor is read only. To be consistent with that, instead of returning the channel just for testing purposes, we have this method to simulate a MySQL restart
func (*MrmsMonitor) Status ¶
func (m *MrmsMonitor) Status() (status map[string]string)
func (*MrmsMonitor) Stop ¶
func (m *MrmsMonitor) Stop() error
type NullClient ¶
type NullClient struct {
// contains filtered or unexported fields
}
func (*NullClient) Conn ¶
func (c *NullClient) Conn() *websocket.Conn
func (*NullClient) Connect ¶
func (c *NullClient) Connect()
func (*NullClient) ConnectChan ¶
func (c *NullClient) ConnectChan() chan bool
func (*NullClient) ConnectOnce ¶
func (c *NullClient) ConnectOnce() error
func (*NullClient) Disconnect ¶
func (c *NullClient) Disconnect() error
func (*NullClient) ErrorChan ¶
func (c *NullClient) ErrorChan() chan error
func (*NullClient) Recv ¶
func (c *NullClient) Recv(data interface{}, timeout uint) error
func (*NullClient) RecvChan ¶
func (c *NullClient) RecvChan() chan *proto.Cmd
func (*NullClient) Send ¶
func (c *NullClient) Send(data interface{}, timeout uint) error
func (*NullClient) SendChan ¶
func (c *NullClient) SendChan() chan *proto.Reply
func (*NullClient) Start ¶
func (c *NullClient) Start()
func (*NullClient) Stop ¶
func (c *NullClient) Stop()
type NullMySQL ¶
type NullMySQL struct { SetCond *sync.Cond Version string CurrentTzOffsetHours int SystemTzOffsetHours int // contains filtered or unexported fields }
func NewNullMySQL ¶
func NewNullMySQL() *NullMySQL
func (*NullMySQL) GetGlobalVarBoolean ¶ added in v1.5.0
func (*NullMySQL) GetGlobalVarInteger ¶ added in v1.5.0
func (*NullMySQL) GetGlobalVarNumeric ¶ added in v1.5.0
func (n *NullMySQL) GetGlobalVarNumeric(varName string) (varValue sql.NullFloat64, err error)
func (*NullMySQL) GetGlobalVarString ¶
func (n *NullMySQL) GetGlobalVarString(varName string) (varValue sql.NullString, err error)
func (*NullMySQL) GetUptimeCount ¶
func (*NullMySQL) SetAtLeastVersion ¶
func (*NullMySQL) SetGlobalVarInteger ¶ added in v1.5.0
func (*NullMySQL) SetGlobalVarNumeric ¶ added in v1.5.0
func (*NullMySQL) SetGlobalVarString ¶
func (*NullMySQL) TableInfo ¶ added in v1.5.0
func (n *NullMySQL) TableInfo(tables *proto.TableInfoQuery) (proto.TableInfoResult, error)
type QanAnalyzer ¶
type QanAnalyzer struct { StartChan chan bool StopChan chan bool ErrorChan chan error CrashChan chan bool ValidateConfigMock func(config pc.QAN) (pc.QAN, error) Defaults map[string]interface{} // contains filtered or unexported fields }
func NewQanAnalyzer ¶
func NewQanAnalyzer(name string) *QanAnalyzer
func (*QanAnalyzer) Config ¶
func (a *QanAnalyzer) Config() pc.QAN
func (*QanAnalyzer) GetDefaults ¶ added in v1.5.0
func (a *QanAnalyzer) GetDefaults(uuid string) map[string]interface{}
func (*QanAnalyzer) SetConfig ¶
func (a *QanAnalyzer) SetConfig(config pc.QAN)
func (*QanAnalyzer) Start ¶
func (a *QanAnalyzer) Start() error
func (*QanAnalyzer) Status ¶
func (a *QanAnalyzer) Status() map[string]string
func (*QanAnalyzer) Stop ¶
func (a *QanAnalyzer) Stop() error
func (*QanAnalyzer) String ¶
func (a *QanAnalyzer) String() string
func (*QanAnalyzer) ValidateConfig ¶ added in v1.5.0
type QanAnalyzerFactory ¶
type QanAnalyzerFactory struct { Args []AnalyzerArgs // contains filtered or unexported fields }
func NewQanAnalyzerFactory ¶
func NewQanAnalyzerFactory(a ...analyzer.Analyzer) *QanAnalyzerFactory
type Spooler ¶
type Spooler struct { FilesOut []string // test provides DataOut map[string][]byte // test provides DataIn []interface{} RejectedFiles []string // contains filtered or unexported fields }
func NewSpooler ¶
func NewSpooler(dataChan chan interface{}) *Spooler
func (*Spooler) CancelFiles ¶
func (s *Spooler) CancelFiles()
type Ticker ¶
type TickerFactory ¶
type TickerFactory struct { Made []uint // contains filtered or unexported fields }
func NewTickerFactory ¶
func NewTickerFactory() *TickerFactory
func (*TickerFactory) Make ¶
func (tf *TickerFactory) Make(atInterval uint, sync bool) ticker.Ticker
func (*TickerFactory) Set ¶
func (tf *TickerFactory) Set(tickers []ticker.Ticker)
type WebsocketClient ¶
type WebsocketClient struct { ErrChan chan error SendError chan error RecvError chan error ConnectError error RecvBytes chan []byte TraceChan chan string // contains filtered or unexported fields }
func NewWebsocketClient ¶
func NewWebsocketClient(sendChan chan *proto.Cmd, recvChan chan *proto.Reply, sendDataChan chan interface{}, recvDataChan chan interface{}) *WebsocketClient
func (*WebsocketClient) Conn ¶
func (c *WebsocketClient) Conn() *websocket.Conn
func (*WebsocketClient) Connect ¶
func (c *WebsocketClient) Connect()
func (*WebsocketClient) ConnectChan ¶
func (c *WebsocketClient) ConnectChan() chan bool
func (*WebsocketClient) ConnectOnce ¶
func (c *WebsocketClient) ConnectOnce(timeout uint) error
func (*WebsocketClient) Disconnect ¶
func (c *WebsocketClient) Disconnect() error
func (*WebsocketClient) DisconnectOnce ¶
func (c *WebsocketClient) DisconnectOnce() error
func (*WebsocketClient) ErrorChan ¶
func (c *WebsocketClient) ErrorChan() chan error
func (*WebsocketClient) Recv ¶
func (c *WebsocketClient) Recv(data interface{}, timeout uint) error
func (*WebsocketClient) RecvChan ¶
func (c *WebsocketClient) RecvChan() chan *proto.Cmd
func (*WebsocketClient) Send ¶
func (c *WebsocketClient) Send(data interface{}, timeout uint) error
func (*WebsocketClient) SendBytes ¶
func (c *WebsocketClient) SendBytes(data []byte, timeout uint) error
func (*WebsocketClient) SendChan ¶
func (c *WebsocketClient) SendChan() chan *proto.Reply
func (*WebsocketClient) SetConnectChan ¶
func (c *WebsocketClient) SetConnectChan(connectChan chan bool)
func (*WebsocketClient) Start ¶
func (c *WebsocketClient) Start()
func (*WebsocketClient) Status ¶
func (c *WebsocketClient) Status() map[string]string
func (*WebsocketClient) Stop ¶
func (c *WebsocketClient) Stop()
type WebsocketServer ¶
type WebsocketServer struct { Clients *clients ClientConnectChan chan *client // contains filtered or unexported fields }
func NewWebsocketServer ¶ added in v1.5.0
func NewWebsocketServer() *WebsocketServer
func (*WebsocketServer) Run ¶
func (s *WebsocketServer) Run(addr string, endpoint string)
addr: http://127.0.0.1:8000 endpoint: /agent
func (*WebsocketServer) RunWss ¶ added in v1.5.0
func (s *WebsocketServer) RunWss(addr string, endpoint string)
addr: https://127.0.0.1:8443 endpoint: /agent
Source Files ¶
Click to show internal directories.
Click to hide internal directories.