Documentation
¶
Index ¶
- Variables
- func DisconnectClient(c *client)
- func NewQanWorkerFactory(workers []*QanWorker) qan.WorkerFactory
- func PingAPI(hostname, apiKey string) (bool, *http.Response)
- 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(string, 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 Clock
- type ConnectionFactory
- type DataClient
- func (c *DataClient) Conn() *websocket.Conn
- func (c *DataClient) Connect()
- func (c *DataClient) ConnectChan() chan bool
- func (c *DataClient) ConnectOnce() error
- func (c *DataClient) Disconnect() 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) 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 HttpClient
- type IntervalIterFactory
- type MmMonitor
- func (m *MmMonitor) Config() interface{}
- func (m *MmMonitor) SetConfig(v interface{})
- func (m *MmMonitor) Start(tickChan chan time.Time, collectionChan chan *mm.Collection) error
- func (m *MmMonitor) Status() map[string]string
- func (m *MmMonitor) Stop() error
- func (m *MmMonitor) TickChan() chan time.Time
- type MmMonitorFactory
- type MockIntervalIter
- type MockServiceManager
- func (m *MockServiceManager) GetConfig() ([]proto.AgentConfig, []error)
- 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 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) error
- func (c *NullClient) SendChan() chan *proto.Reply
- func (c *NullClient) Start()
- func (c *NullClient) Stop()
- type NullMySQL
- func (n *NullMySQL) Close()
- func (n *NullMySQL) Connect(tries uint) error
- func (n *NullMySQL) DB() *sql.DB
- func (n *NullMySQL) DSN() string
- func (n *NullMySQL) GetGlobalVarString(varName string) string
- func (n *NullMySQL) GetSet() []mysql.Query
- func (n *NullMySQL) Reset()
- func (n *NullMySQL) Set(queries []mysql.Query) error
- type QanWorker
- type QanWorkerFactory
- type Spooler
- func (s *Spooler) Files() <-chan string
- func (s *Spooler) Read(file string) ([]byte, error)
- func (s *Spooler) Remove(file string) error
- func (s *Spooler) Start(sz data.Serializer) error
- func (s *Spooler) Status() map[string]string
- func (s *Spooler) Stop() error
- func (s *Spooler) Write(service string, data interface{}) error
- type SysconfigMonitor
- func (m *SysconfigMonitor) Config() interface{}
- func (m *SysconfigMonitor) SetConfig(v interface{})
- func (m *SysconfigMonitor) Start(tickChan chan time.Time, reportChan chan *sysconfig.Report) error
- func (m *SysconfigMonitor) Status() map[string]string
- func (m *SysconfigMonitor) Stop() error
- func (m *SysconfigMonitor) TickChan() chan time.Time
- type SysconfigMonitorFactory
- 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() error
- func (c *WebsocketClient) Disconnect() 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) 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 ClientConnectChan = make(chan *client, 1)
View Source
var ClientDisconnectChan = make(chan *client)
View Source
var ClientRmChan = make(chan *client, 5)
View Source
var Clients = make(map[*client]*client)
View Source
var RecvChan chan interface{}
View Source
var SendChan chan interface{}
Functions ¶
func DisconnectClient ¶
func DisconnectClient(c *client)
func NewQanWorkerFactory ¶
func NewQanWorkerFactory(workers []*QanWorker) qan.WorkerFactory
Types ¶
type API ¶
type API struct {
GetCode []int
GetData [][]byte
GetError []error
// contains filtered or unexported fields
}
type ConnectionFactory ¶
type ConnectionFactory struct {
Conn *NullMySQL
}
type DataClient ¶
type DataClient struct {
// --
ErrChan chan error
RecvError chan error
// 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() error
func (*DataClient) Disconnect ¶
func (c *DataClient) Disconnect() 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) 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 HttpClient ¶
type HttpClient struct {
PostChan chan []byte
}
type IntervalIterFactory ¶
type IntervalIterFactory struct {
Iters []qan.IntervalIter
TickChans map[qan.IntervalIter]chan time.Time
// contains filtered or unexported fields
}
func (*IntervalIterFactory) Make ¶
func (tf *IntervalIterFactory) Make(filename qan.FilenameFunc, tickChan chan time.Time) qan.IntervalIter
func (*IntervalIterFactory) Reset ¶
func (tf *IntervalIterFactory) Reset()
type MmMonitor ¶
type MmMonitor struct {
ReadyChan chan bool
// contains filtered or unexported fields
}
func NewMmMonitor ¶
func NewMmMonitor() *MmMonitor
type MmMonitorFactory ¶
type MmMonitorFactory struct {
Made []string
// contains filtered or unexported fields
}
func NewMmMonitorFactory ¶
func NewMmMonitorFactory(monitors map[string]mm.Monitor) *MmMonitorFactory
type MockIntervalIter ¶
type MockIntervalIter struct {
// contains filtered or unexported fields
}
func NewMockIntervalIter ¶
func NewMockIntervalIter(intervalChan chan *qan.Interval) *MockIntervalIter
func (*MockIntervalIter) IntervalChan ¶
func (i *MockIntervalIter) IntervalChan() chan *qan.Interval
func (*MockIntervalIter) Start ¶
func (i *MockIntervalIter) Start()
func (*MockIntervalIter) Stop ¶
func (i *MockIntervalIter) Stop()
type MockServiceManager ¶
type MockServiceManager struct {
StartErr error
StopErr error
IsRunningVal bool
// contains filtered or unexported fields
}
func NewMockServiceManager ¶
func NewMockServiceManager(name string, readyChan chan bool, traceChan chan string) *MockServiceManager
func (*MockServiceManager) GetConfig ¶
func (m *MockServiceManager) GetConfig() ([]proto.AgentConfig, []error)
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 NullClient ¶
type NullClient struct {
// contains filtered or unexported fields
}
func NewNullClient ¶
func NewNullClient() *NullClient
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) SendBytes ¶
func (c *NullClient) SendBytes(data []byte) 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 {
// contains filtered or unexported fields
}
func NewNullMySQL ¶
func NewNullMySQL() *NullMySQL
func (*NullMySQL) GetGlobalVarString ¶
type QanWorker ¶
func NewQanWorker ¶
type QanWorkerFactory ¶
type QanWorkerFactory struct {
// contains filtered or unexported fields
}
type Spooler ¶
type Spooler struct {
FilesOut []string // test provides
DataOut map[string][]byte // test provides
DataIn []interface{}
// contains filtered or unexported fields
}
func NewSpooler ¶
func NewSpooler(dataChan chan interface{}) *Spooler
type SysconfigMonitor ¶
type SysconfigMonitor struct {
ReadyChan chan bool
// contains filtered or unexported fields
}
func NewSysconfigMonitor ¶
func NewSysconfigMonitor() *SysconfigMonitor
func (*SysconfigMonitor) Config ¶
func (m *SysconfigMonitor) Config() interface{}
func (*SysconfigMonitor) SetConfig ¶
func (m *SysconfigMonitor) SetConfig(v interface{})
func (*SysconfigMonitor) Status ¶
func (m *SysconfigMonitor) Status() map[string]string
func (*SysconfigMonitor) Stop ¶
func (m *SysconfigMonitor) Stop() error
func (*SysconfigMonitor) TickChan ¶
func (m *SysconfigMonitor) TickChan() chan time.Time
type SysconfigMonitorFactory ¶
type SysconfigMonitorFactory struct {
Made []string
// contains filtered or unexported fields
}
func NewSysconfigMonitorFactory ¶
func NewSysconfigMonitorFactory(monitors []sysconfig.Monitor) *SysconfigMonitorFactory
func (*SysconfigMonitorFactory) Set ¶
func (f *SysconfigMonitorFactory) Set(monitors []sysconfig.Monitor)
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
RecvError chan 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() error
func (*WebsocketClient) Disconnect ¶
func (c *WebsocketClient) Disconnect() 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) 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 {
}
func (*WebsocketServer) Run ¶
func (s *WebsocketServer) Run(addr string, endpoint string)
addr: http://127.0.0.1:8000 endpoint: /agent
Click to show internal directories.
Click to hide internal directories.