topics

package
v0.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2018 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package topics is a generated protocol buffer package.

It is generated from these files:

types.proto

It has these top-level messages:

RetainedMessage
RetainedMessageList

Index

Constants

View Source
const (
	RetainedMessageCreated string = "retained_message_created"
	RetainedMessageDeleted string = "retained_message_deleted"
)

Variables

View Source
var (
	ErrNodeNotFound = fmt.Errorf("node not found")
)
View Source
var (
	ErrRetainedMessageNotFound = errors.New("retained message not found")
)
View Source
var (
	SEP = byte('/')
)

Functions

func HasID

func HasID(id string) retainedMessageFilter

func HasIDIn

func HasIDIn(set []string) retainedMessageFilter

func HasTenant

func HasTenant(tenant string) retainedMessageFilter

func IsOutdated

func IsOutdated(s *RetainedMessage, remote *RetainedMessage) (outdated bool)

func MakeTopicID

func MakeTopicID(tenant string, topic []byte) (string, error)

func MatchTopicPattern

func MatchTopicPattern(pattern []byte) retainedMessageFilter

func NewMemDBStore

func NewMemDBStore(router Router) (*memDBStore, error)

func TenantTopicIndexer

func TenantTopicIndexer() *topicIndexer

Types

type ByteSliceIndexer

type ByteSliceIndexer struct {
	// contains filtered or unexported fields
}

func (*ByteSliceIndexer) FromArgs

func (b *ByteSliceIndexer) FromArgs(opts ...interface{}) ([]byte, error)

func (*ByteSliceIndexer) FromObject

func (b *ByteSliceIndexer) FromObject(obj interface{}) (bool, []byte, error)

type Node

type Node struct {
	Id      string
	Message *RetainedMessage
	Tenant  string
	// contains filtered or unexported fields
}

func NewNode

func NewNode(id, tenant string) *Node

func (*Node) AddChild

func (n *Node) AddChild(id, tenant string) *Node

func (*Node) Apply

func (n *Node) Apply(tenant string, topic *Topic, f func(*Node) bool)

func (*Node) Child

func (n *Node) Child(id string) (*Node, bool)

func (*Node) Children

func (n *Node) Children(tenant string) map[string]*Node

func (*Node) Upsert

func (n *Node) Upsert(tenant string, topic *Topic) *Node

type RetainedMessage

type RetainedMessage struct {
	ID          string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	Tenant      string `protobuf:"bytes,2,opt,name=Tenant" json:"Tenant,omitempty"`
	Topic       []byte `protobuf:"bytes,3,opt,name=Topic,proto3" json:"Topic,omitempty"`
	Payload     []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"`
	Qos         int32  `protobuf:"varint,5,opt,name=Qos" json:"Qos,omitempty"`
	LastAdded   int64  `protobuf:"varint,6,opt,name=LastAdded" json:"LastAdded,omitempty"`
	LastDeleted int64  `protobuf:"varint,7,opt,name=LastDeleted" json:"LastDeleted,omitempty"`
}

func (*RetainedMessage) Descriptor

func (*RetainedMessage) Descriptor() ([]byte, []int)

func (*RetainedMessage) GetID

func (m *RetainedMessage) GetID() string

func (*RetainedMessage) GetLastAdded

func (m *RetainedMessage) GetLastAdded() int64

func (*RetainedMessage) GetLastDeleted

func (m *RetainedMessage) GetLastDeleted() int64

func (*RetainedMessage) GetPayload

func (m *RetainedMessage) GetPayload() []byte

func (*RetainedMessage) GetQos

func (m *RetainedMessage) GetQos() int32

func (*RetainedMessage) GetTenant

func (m *RetainedMessage) GetTenant() string

func (*RetainedMessage) GetTopic

func (m *RetainedMessage) GetTopic() []byte

func (*RetainedMessage) IsAdded

func (s *RetainedMessage) IsAdded() bool

func (*RetainedMessage) IsRemoved

func (s *RetainedMessage) IsRemoved() bool

func (*RetainedMessage) ProtoMessage

func (*RetainedMessage) ProtoMessage()

func (*RetainedMessage) Reset

func (m *RetainedMessage) Reset()

func (*RetainedMessage) String

func (m *RetainedMessage) String() string

type RetainedMessageList

type RetainedMessageList struct {
	RetainedMessages []*RetainedMessage `protobuf:"bytes,1,rep,name=RetainedMessages" json:"RetainedMessages,omitempty"`
}

func (*RetainedMessageList) Append

func (e *RetainedMessageList) Append(entry state.Entry)

func (RetainedMessageList) Apply

func (set RetainedMessageList) Apply(f func(s *RetainedMessage))

func (RetainedMessageList) ApplyE

func (set RetainedMessageList) ApplyE(f func(s *RetainedMessage) error) error

func (RetainedMessageList) ApplyIdx

func (set RetainedMessageList) ApplyIdx(f func(idx int, s *RetainedMessage))

func (*RetainedMessageList) AtIndex

func (e *RetainedMessageList) AtIndex(idx int) state.Entry

func (*RetainedMessageList) Descriptor

func (*RetainedMessageList) Descriptor() ([]byte, []int)

func (RetainedMessageList) Filter

func (set RetainedMessageList) Filter(filters ...retainedMessageFilter) RetainedMessageList

func (*RetainedMessageList) GetRetainedMessages

func (m *RetainedMessageList) GetRetainedMessages() []*RetainedMessage

func (*RetainedMessageList) Length

func (e *RetainedMessageList) Length() int

func (*RetainedMessageList) New

func (*RetainedMessageList) ProtoMessage

func (*RetainedMessageList) ProtoMessage()

func (*RetainedMessageList) Range

func (e *RetainedMessageList) Range(f func(idx int, entry state.Entry))

func (*RetainedMessageList) Reset

func (m *RetainedMessageList) Reset()

func (*RetainedMessageList) Set

func (e *RetainedMessageList) Set(idx int, entry state.Entry)

func (*RetainedMessageList) String

func (m *RetainedMessageList) String() string

type Router

type Router interface {
	NewGossip(channel string, gossiper mesh.Gossiper) (mesh.Gossip, error)
}

type Store

type Store interface {
	Create(message *RetainedMessage) error
	ByTopicPattern(tenant string, pattern []byte) (RetainedMessageList, error)
	All() (RetainedMessageList, error)
}

type Topic

type Topic struct {
	// contains filtered or unexported fields
}

func NewTopic

func NewTopic(topic []byte) *Topic

func (*Topic) Bytes

func (t *Topic) Bytes() []byte

func (*Topic) Chop

func (t *Topic) Chop() (*Topic, string, bool)

func (*Topic) Cur

func (t *Topic) Cur() []byte

func (*Topic) Head

func (t *Topic) Head() []byte

Head returns the previous tokens and separators

func (*Topic) Length

func (t *Topic) Length() int

func (*Topic) Match

func (t *Topic) Match(pattern []byte) bool

func (*Topic) Next

func (t *Topic) Next() error

Next advances to the next token, and return the read token

func (*Topic) Tail

func (t *Topic) Tail() []byte

Head returns the tokens and separators after the cursor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL