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 Ops []graph.PartiallyUpdatedOp }
PartiallyUpdatedMsg describes multiple graph modifications
type SyncRequestMsg ¶
SyncRequestMsg describes a graph synchro request message
func (*SyncRequestMsg) UnmarshalJSON ¶
func (s *SyncRequestMsg) UnmarshalJSON(b []byte) error
UnmarshalJSON custom unmarshal function
Click to show internal directories.
Click to hide internal directories.