visserver

package
v0.0.0-...-2ebb9f0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionGet            = "get"
	ActionSet            = "set"
	ActionAuth           = "authorize"
	ActionSubscribe      = "subscribe"
	ActionUnsubscribe    = "unsubscribe"
	ActionUnsubscribeAll = "unsubscribeAll"
	ActionSubscription   = "subscription"
)

VIS actions.

Variables

This section is empty.

Functions

This section is empty.

Types

type PermissionProvider

type PermissionProvider interface {
	GetVisPermissionByToken(token string) (permissions map[string]string, err error)
}

PermissionProvider interface to get permissions.

type Server

type Server struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Server update manager server structure.

func New

func New(config *config.Config, permissionProvider PermissionProvider) (server *Server, err error)

New creates new Web socket server.

func (*Server) ClientConnected

func (server *Server) ClientConnected(client *wsserver.Client)

ClientConnected connect client notification.

func (*Server) ClientDisconnected

func (server *Server) ClientDisconnected(wsClient *wsserver.Client)

ClientDisconnected disconnect client notification.

func (*Server) Close

func (server *Server) Close()

Close closes web socket server and all connections.

func (*Server) GetPermissionProvider

func (server *Server) GetPermissionProvider() (permissionProvider PermissionProvider)

GetPermissionProvider returns permission provider interface.

func (*Server) ProcessMessage

func (server *Server) ProcessMessage(
	wsClient *wsserver.Client, messageType int, message []byte,
) (response []byte, err error)

ProcessMessage processes incoming messages.

Jump to

Keyboard shortcuts

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