common

package
v0.0.0-...-5d36fff Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxMessageSize = 8192
	RWTimeout      = 60 * time.Second
	HBTimeout      = RWTimeout / 2
)

Variables

This section is empty.

Functions

func GetLocalTime

func GetLocalTime() (*time.Location, error)

func InitLogging

func InitLogging(forceColours, disableTimestamp bool)

func InitSyslog

func InitSyslog()

func InitUid

func InitUid() error

func ManageHeartbeats

func ManageHeartbeats(cm ConnectionManager)

func SetPongHandler

func SetPongHandler(conn *WebsocketConn)

Types

type ConnectionManager

type ConnectionManager interface {
	GetConnections() []*WebsocketConn
	RemoveConnection(conn *WebsocketConn)
}

type LoginMessage

type LoginMessage struct {
	AsReceiver bool   `json:"as_receiver"`
	Token      string `json:"token"`
}

type WebsocketConn

type WebsocketConn struct {
	Conn *websocket.Conn
	Desc string
}

func NewWebsocketConn

func NewWebsocketConn(conn *websocket.Conn, descFmt string, args ...interface{}) *WebsocketConn

func (WebsocketConn) String

func (wsc WebsocketConn) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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