msg

package
v0.17.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MSG_NONE = iota
	MSG_BOOTSTRAP

	MSG_REGISTER // Used when passing registration messages

	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_SYNC_USER_SPACES

	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 WriteMessage

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

Types

type LeafOriginMessage added in v0.17.0

type LeafOriginMessage struct {
	Command byte
	Payload interface{}
}

message used internally between the leaf and origin

type Message added in v0.17.0

type Message struct {
	Command byte
	// contains filtered or unexported fields
}

func ReadMessgae added in v0.17.0

func ReadMessgae(ws *websocket.Conn) (*Message, error)

func (*Message) UnmarshalPayload added in v0.17.0

func (p *Message) UnmarshalPayload(v interface{}) error

type Register

type Register struct {
	Version   string
	Location  string
	SessionId string
}

message sent from a 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
	SessionId      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
}

type SyncUserSpaces added in v0.17.0

type SyncUserSpaces struct {
	UserId   string
	Existing []string
}

type UpdateSpace added in v0.17.0

type UpdateSpace struct {
	Space        model.Space
	UpdateFields []string
}

message sent from server to a follower to update a space

type UpdateTemplate added in v0.17.0

type UpdateTemplate struct {
	Template     model.Template
	UpdateFields []string
}

type UpdateUser added in v0.17.0

type UpdateUser struct {
	User         model.User
	UpdateFields []string
}

message sent from server to a left to update a user

type UpdateVolume added in v0.17.0

type UpdateVolume struct {
	Volume       model.Volume
	UpdateFields []string
}

message sent from server to a left to update a user

Jump to

Keyboard shortcuts

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