Documentation ¶
Index ¶
- Constants
- func Prefix(parts []Part) uint64
- type ID
- type Part
- type Topic
- func (t *Topic) AddContract(contract uint32)
- func (t *Topic) GetHash(contract uint32) uint64
- func (t *Topic) GetHashCode() uint32
- func (t *Topic) Last() (time.Time, int, bool)
- func (t *Topic) Marshal() []byte
- func (t *Topic) Parse(contract uint32, wildcard bool)
- func (t *Topic) ParseKey(text []byte)
- func (t *Topic) TTL() (uint32, bool)
- func (t *Topic) Unmarshal(data []byte) error
- type TopicOption
Constants ¶
View Source
const ( TopicInvalid = uint8(iota) TopicStatic TopicWildcard TopicWildcardSymbol = '*' TopicMultiWildcardSymbol = "..." TopicSeparator = '.' // The separator character. TopicMaxDepth = 100 // Maximum depth for topic using a separator // Wildcard wildcard is hash for wildcard topic such as '*' or '...' Wildcard = uint32(857445537) )
Various constant on Topic.
View Source
const ( // MasterContract contract is default contract used for topics if client program does not specify Contract in the request. MasterContract = uint32(3376684800) )
Various constant parts of the ID.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ID ¶
type ID []byte
ID represents a message ID and lexigraphically sortable.
func NewID ¶
NewID generates a new message identifier with a prefix. Master contract is adde to the ID and actual Contract is set later.
func (ID) EvalPrefix ¶
EvalPrefix matches the prefix with the cutoff time.
func (*ID) SetContract ¶ added in v0.1.1
SetContract sets Contract on ID.
type Topic ¶
type Topic struct { Topic []byte // Gets or sets the topic string. TopicOptions []byte Parts []Part Depth uint8 Options []TopicOption // Gets or sets the options. TopicType uint8 }
Topic represents a parsed topic.
func (*Topic) AddContract ¶
AddContract adds contract to the parts of a topic.
func (*Topic) GetHashCode ¶
GetHashCode combines the topic parts into a single hash.
type TopicOption ¶
TopicOption represents a key/value pair option.
Click to show internal directories.
Click to hide internal directories.