consolepump

package
v0.0.0-...-d3cbdd1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsolePump

type ConsolePump struct {
	ConnsMu sync.RWMutex              `json:"-"`
	Conns   map[int64]*websocket.Conn `json:"-"`

	ConnMuMu sync.RWMutex          `json:"-"`
	ConnMu   map[int64]*sync.Mutex `json:"-"`
	// contains filtered or unexported fields
}

ConsolePump handles serving the current logs on the dashboard through Websocket.

func NewConsolePump

func NewConsolePump() *ConsolePump

NewConsolePump creates a new console pump.

func (*ConsolePump) DeregisterConnection

func (cp *ConsolePump) DeregisterConnection(id int64) (ok bool)

DeregisterConnection removes a connection from the pump. Returns boolean if it was removed.

func (*ConsolePump) RegisterConnection

func (cp *ConsolePump) RegisterConnection(conn *websocket.Conn) (id int64)

RegisterConnection will take the already established websocket and add it to the pump.

func (*ConsolePump) Write

func (cp *ConsolePump) Write(p []byte) (n int, err error)

Write implements io.Writer.

Jump to

Keyboard shortcuts

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