messages

package
v0.0.0-...-b4bb62b Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncMsgType                 = "Sync"
	SyncRequestMsgType          = "SyncRequest"
	SyncReplyMsgType            = "SyncReply"
	NodeUpdatedMsgType          = "NodeUpdated"
	NodeDeletedMsgType          = "NodeDeleted"
	NodeAddedMsgType            = "NodeAdded"
	EdgeUpdatedMsgType          = "EdgeUpdated"
	EdgeDeletedMsgType          = "EdgeDeleted"
	EdgeAddedMsgType            = "EdgeAdded"
	NodePartiallyUpdatedMsgType = "NodePartiallyUpdated"
	EdgePartiallyUpdatedMsgType = "EdgePartiallyUpdated"
)

Graph message type

View Source
const (
	// Namespace used for WebSocket message
	Namespace = "Graph"
)

Variables

View Source
var (
	ErrSyncRequestMalFormed = errors.New("SyncRequestMsg malformed")
	ErrSyncMsgMalFormed     = errors.New("SyncMsg/SyncReplyMsg malformed")
)

Graph error message

Functions

func NewStructMessage

func NewStructMessage(typ string, i interface{}) *ws.StructMessage

NewStructMessage returns a new graffiti websocket StructMessage

func UnmarshalMessage

func UnmarshalMessage(msg *ws.StructMessage) (string, interface{}, error)

UnmarshalMessage unmarshal graph message

Types

type PartiallyUpdatedMsg

type PartiallyUpdatedMsg struct {
	ID        graph.Identifier
	UpdatedAt graph.Time
	Revision  int64
	Ops       []graph.PartiallyUpdatedOp
}

PartiallyUpdatedMsg describes multiple graph modifications

type PartiallyUpdatedOpMsg

type PartiallyUpdatedOpMsg struct {
	Type  graph.PartiallyUpdatedOpType
	Key   string
	Value json.RawMessage
}

PartiallyUpdatedOpMsg describes a partial update operation message

type PartiallyUpdatedRawMsg

type PartiallyUpdatedRawMsg struct {
	ID        graph.Identifier
	UpdatedAt graph.Time
	Revision  int64
	Ops       []PartiallyUpdatedOpMsg
}

PartiallyUpdatedRawMsg describes multiple graph modifications

func (*PartiallyUpdatedRawMsg) Decode

Decode a raw partial update message

type SyncMsg

type SyncMsg struct {
	*graph.Elements
}

SyncMsg describes graph synchro message

type SyncRequestMsg

type SyncRequestMsg struct {
	graph.Context
	GremlinFilter *string
}

SyncRequestMsg describes a graph synchro request message

func (*SyncRequestMsg) UnmarshalJSON

func (s *SyncRequestMsg) UnmarshalJSON(b []byte) error

UnmarshalJSON custom unmarshal function

Jump to

Keyboard shortcuts

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