Documentation ¶
Index ¶
- Variables
- type BrowserMessage
- type CollectorServer
- func (api *CollectorServer) ApiDoc(ctx echo.Context) error
- func (c *CollectorServer) DashBoard(ctx echo.Context) (err error)
- func (c *CollectorServer) Home(ctx echo.Context) (err error)
- func (api *CollectorServer) Info(ctx echo.Context) error
- func (c *CollectorServer) SetRoutes()
- func (c *CollectorServer) WatcherCheck(ctx echo.Context) (err error)
- func (c *CollectorServer) WatcherDocumentation(ctx echo.Context) (err error)
- type Info
- type WebSocketServer
- type WsMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Version = "0.2.2"
)
Functions ¶
This section is empty.
Types ¶
type BrowserMessage ¶
type BrowserMessage struct { Subject string Msg watcher.WatcherMessage // { Result int } }
BrowserMessage The message send to browser via websocket
func NewBrowserMessage ¶
func NewBrowserMessage(subject string, msg watcher.WatcherMessage) BrowserMessage
func NewBrowserMessageFromRaw ¶
func NewBrowserMessageFromRaw(subject string, raw []byte) (BrowserMessage, error)
NewBrowserMessageFromRaw create BrowserMessage from raw watcherMessage
func (*BrowserMessage) Decode ¶
func (m *BrowserMessage) Decode(data []byte) (err error)
func (*BrowserMessage) Encode ¶
func (m *BrowserMessage) Encode() (data []byte, err error)
type CollectorServer ¶
type CollectorServer struct { *echo.Echo StartTime time.Time // webSocketServer to send message to browser WebSocketServer *WebSocketServer Description string Version string Links map[string]string ApiVersion string // contains filtered or unexported fields }
func NewCollectorServer ¶
func NewCollectorServer(ctx context.Context, assets *assets.Assets, collector collectorApi.CollectorRequester) *CollectorServer
NewcollectorServer : create the server
func (*CollectorServer) ApiDoc ¶
func (api *CollectorServer) ApiDoc(ctx echo.Context) error
jsondoc : download watcher documentation
func (*CollectorServer) DashBoard ¶
func (c *CollectorServer) DashBoard(ctx echo.Context) (err error)
func (*CollectorServer) Info ¶
func (api *CollectorServer) Info(ctx echo.Context) error
Info an echo handler for general info
func (*CollectorServer) SetRoutes ¶
func (c *CollectorServer) SetRoutes()
func (*CollectorServer) WatcherCheck ¶
func (c *CollectorServer) WatcherCheck(ctx echo.Context) (err error)
func (*CollectorServer) WatcherDocumentation ¶
func (c *CollectorServer) WatcherDocumentation(ctx echo.Context) (err error)
type WebSocketServer ¶
type WebSocketServer struct {
// contains filtered or unexported fields
}
func NewWebsocketServer ¶
func NewWebsocketServer() *WebSocketServer
func (*WebSocketServer) RegisterWebSocket ¶
func (ws *WebSocketServer) RegisterWebSocket(e *echo.Echo)
StartWebSocket : ws socket to send update status message to browser { subject: "watcher.watcherId.checkId" , msg: "1" }
func (*WebSocketServer) StartWatcherStatusUpdater ¶
func (ws *WebSocketServer) StartWatcherStatusUpdater(nc *nats.Conn) (err error)
func (*WebSocketServer) WsGet ¶
func (ws *WebSocketServer) WsGet() (msg WsMessage)
WsGet: get message from channel used to read message from channel
func (*WebSocketServer) WsSend ¶
func (ws *WebSocketServer) WsSend(subject string, msg []byte)
WsSend : write message to channel used by nats subscription to send data to channel
Click to show internal directories.
Click to hide internal directories.