msg

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSG_NONE = iota
	MSG_BOOTSTRAP
	MSG_PING

	MSG_SYNC_TEMPLATES // Sent to origin server to request all templates
	MSG_UPDATE_TEMPLATE
	MSG_DELETE_TEMPLATE

	MSG_SYNC_USER // Sent to origin server to request a user be synced
	MSG_UPDATE_USER
	MSG_DELETE_USER

	MSG_SYNC_TEMPLATEVARS // Sent to origin server to request all template variables
	MSG_UPDATE_TEMPLATEVAR
	MSG_DELETE_TEMPLATEVAR

	MSG_SYNC_SPACE // Sent to origin server to request a space sync back to the leaf
	MSG_UPDATE_SPACE
	MSG_DELETE_SPACE

	MSG_UPDATE_VOLUME // Sent to origin server to update a volume

	MSG_MIRROR_TOKEN // Sent to origin to create a token as a mirror to a leaf token
	MSG_DELETE_TOKEN

	MSG_SYNC_ROLES // Sent to origin server to request all roles
	MSG_UPDATE_ROLE
	MSG_DELETE_ROLE
)

Variables

This section is empty.

Functions

func ReadCommand

func ReadCommand(ws *websocket.Conn) (byte, error)

func ReadMessage

func ReadMessage(ws *websocket.Conn, v interface{}) error

func WriteCommand

func WriteCommand(ws *websocket.Conn, cmdType byte) error

func WriteMessage

func WriteMessage(ws *websocket.Conn, payload interface{}) error

Types

type ClientMessage

type ClientMessage struct {
	Command byte
	Payload interface{}
}

message used internally over the leader / follower channels

type Register

type Register struct {
	Version  string
	Location string
}

message sent from an follower to the leader to register itself

type RegisterResponse

type RegisterResponse struct {
	Success        bool
	RestrictedNode bool // flags the node is registered as a restricted node
	Version        string
	Location       string
	Timezone       string
}

message sent from the leader to the follower in response to a register message

type SyncTemplateVars

type SyncTemplateVars struct {
	Existing []string
}

type SyncTemplates

type SyncTemplates struct {
	Existing []string
}

Jump to

Keyboard shortcuts

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