Documentation ¶
Index ¶
- Constants
- func Contract(parts []Part) uint64
- type ID
- type Part
- type Topic
- func (t *Topic) AddContract(contract uint32)
- func (t *Topic) GetHash(contract uint64) 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() (int64, bool)
- func (t *Topic) Target() uint32
- func (t *Topic) Unmarshal(data []byte) error
- type TopicOption
Constants ¶
View Source
const ( // MasterContract contract is default contract used for topics if client program does not specify Contract in the request MasterContract = uint32(3376684800) // Wildcard wildcard is hash for wildcard topic such as '*' Wildcard = uint32(857445537) None = uint32(0) // ID has no flags. Encrypted = uint32(1 << 0) // ID has encryption set. )
Various constant parts of the ID.
View Source
const ( TopicInvalid = uint8(iota) TopicStatic TopicWildcard TopicAnySeparator = '*' TopicChildrenAllSeparator = "..." TopicSeparator = '.' // The separator character. MaxMessageSize = 65536 // Maximum message size allowed. TopicMaxDepth = 100 // Maximum depth for topic using a separator )
Various constant on Topic
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ID ¶
type ID []byte
ID represents a message ID encoded at 128bit and lexigraphically sortable
func NewID ¶
NewID generates a new message identifier without containing a prefix. Prefix is set later when arrives.
func (*ID) AddContract ¶
AddContract adds a Contract to ID, it is used to validate prefix.
func (ID) EvalPrefix ¶
EvalPrefix matches the prefix with the cutoff time.
func (ID) IsEncrypted ¶
IsEncrypted return if an encryption is set 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.