Documentation ¶
Index ¶
Constants ¶
const ( Mimetype = "application/msgpack" SchemaName = "metatopic.TopicUpdate" SchemaVersion = "1.0.0" )
Constants useful for creating ensign Events.
Variables ¶
This section is empty.
Functions ¶
func ParseVersion ¶
func ParseVersion() (major, minor, patch uint32)
Parse the version components of the schema version to create an event version.
Types ¶
type Activity ¶
Activity represents the number of active/inactive items in a group. The total number of items in a group is the sum of active + inactive.
func (*Activity) PercentActive ¶
func (*Activity) PercentInactive ¶
type Topic ¶
type Topic struct { ID []byte `msgpack:"id"` ProjectID []byte `msgpack:"project_id"` Name string `msgpack:"name"` ReadOnly bool `msgpack:"readonly"` Offset uint64 `msgpack:"offset"` Shards uint32 `msgpack:"shards"` Storage float64 `msgpack:"storage"` Publishers *Activity `msgpack:"publishers"` Subscribers *Activity `msgpack:"subscribers"` Created time.Time `msgpack:"created"` Modified time.Time `msgpack:"modified"` }
A non-protocol buffer representation of the Topic. In the Topic Update struct it represents the modified topic (e.g. the current version of the topic). TODO: add placements and types to this struct.
type TopicUpdate ¶
type TopicUpdate struct { UpdateType TopicUpdateType `msgpack:"update_type"` OrgID ulid.ULID `msgpack:"org_id,omitempty"` ProjectID ulid.ULID `msgpack:"project_id"` TopicID ulid.ULID `msgpack:"topic_id"` ClientID string `msgpack:"client_id"` Topic *Topic `msgpack:"topic,omitempty"` }
This is the top-level event type that is sent on the metatopic topic. It describes an update to a specific topic and provides information about the topic and how it was modified, and, if available, who it was modified by.
func (*TopicUpdate) Marshal ¶
func (t *TopicUpdate) Marshal() ([]byte, error)
func (*TopicUpdate) Unmarshal ¶
func (t *TopicUpdate) Unmarshal(data []byte) error
type TopicUpdateType ¶
type TopicUpdateType uint8
The type of update made to the topic, e.g. created, modified, deleted, etc.
const ( TopicUpdateUnknown TopicUpdateType = iota TopicUpdateCreated TopicUpdateModified TopicUpdateStateChange TopicUpdateDeleted )
func (TopicUpdateType) String ¶
func (t TopicUpdateType) String() string