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 ¶
func (m *PartiallyUpdatedRawMsg) Decode(decoders map[string]graph.MetadataDecoder) (*PartiallyUpdatedMsg, error)
Decode a raw partial update message
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.