v0.0.0-...-da29e9d Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2021 License: MIT Imports: 16 Imported by: 0




This section is empty.


View Source
var (
	Version = "0.2.2"


This section is empty.


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 {

	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) Home

func (c *CollectorServer) Home(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 Info

type Info struct {
	Version string

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

type WsMessage

type WsMessage struct {
	Msg []byte
	// contains filtered or unexported fields

WsMessage message passed via channel

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL