topics

package
v0.0.63-rc55 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetainedMessageCreated string = "retained_message_created"
	RetainedMessageDeleted        = "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 MatchTopicPattern

func MatchTopicPattern(pattern []byte) retainedMessageFilter

func NewMemDBStore

func NewMemDBStore(mesh types.ServiceLayer) (*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 Channel added in v0.0.37

type Channel interface {
	Broadcast([]byte)
}

type Metadata added in v0.0.39

type Metadata struct {
	ID                   string   `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Tenant               string   `protobuf:"bytes,2,opt,name=Tenant,proto3" 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,proto3" json:"Qos,omitempty"`
	LastAdded            int64    `protobuf:"varint,6,opt,name=LastAdded,proto3" json:"LastAdded,omitempty"`
	LastDeleted          int64    `protobuf:"varint,7,opt,name=LastDeleted,proto3" json:"LastDeleted,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Metadata) Descriptor added in v0.0.39

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

func (*Metadata) GetID added in v0.0.39

func (m *Metadata) GetID() string

func (*Metadata) GetLastAdded added in v0.0.39

func (m *Metadata) GetLastAdded() int64

func (*Metadata) GetLastDeleted added in v0.0.39

func (m *Metadata) GetLastDeleted() int64

func (*Metadata) GetPayload added in v0.0.39

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

func (*Metadata) GetQos added in v0.0.39

func (m *Metadata) GetQos() int32

func (*Metadata) GetTenant added in v0.0.39

func (m *Metadata) GetTenant() string

func (*Metadata) GetTopic added in v0.0.39

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

func (*Metadata) ProtoMessage added in v0.0.39

func (*Metadata) ProtoMessage()

func (*Metadata) Reset added in v0.0.39

func (m *Metadata) Reset()

func (*Metadata) String added in v0.0.39

func (m *Metadata) String() string

func (*Metadata) XXX_DiscardUnknown added in v0.0.51

func (m *Metadata) XXX_DiscardUnknown()

func (*Metadata) XXX_Marshal added in v0.0.51

func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Metadata) XXX_Merge added in v0.0.51

func (m *Metadata) XXX_Merge(src proto.Message)

func (*Metadata) XXX_Size added in v0.0.51

func (m *Metadata) XXX_Size() int

func (*Metadata) XXX_Unmarshal added in v0.0.51

func (m *Metadata) XXX_Unmarshal(b []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 {
	Metadata
}

type RetainedMessageMetadataList added in v0.0.39

type RetainedMessageMetadataList struct {
	Metadatas            []*Metadata `protobuf:"bytes,1,rep,name=Metadatas,proto3" json:"Metadatas,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

func (*RetainedMessageMetadataList) Descriptor added in v0.0.39

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

func (*RetainedMessageMetadataList) GetMetadatas added in v0.0.39

func (m *RetainedMessageMetadataList) GetMetadatas() []*Metadata

func (*RetainedMessageMetadataList) ProtoMessage added in v0.0.39

func (*RetainedMessageMetadataList) ProtoMessage()

func (*RetainedMessageMetadataList) Reset added in v0.0.39

func (m *RetainedMessageMetadataList) Reset()

func (*RetainedMessageMetadataList) String added in v0.0.39

func (m *RetainedMessageMetadataList) String() string

func (*RetainedMessageMetadataList) XXX_DiscardUnknown added in v0.0.51

func (m *RetainedMessageMetadataList) XXX_DiscardUnknown()

func (*RetainedMessageMetadataList) XXX_Marshal added in v0.0.51

func (m *RetainedMessageMetadataList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RetainedMessageMetadataList) XXX_Merge added in v0.0.51

func (m *RetainedMessageMetadataList) XXX_Merge(src proto.Message)

func (*RetainedMessageMetadataList) XXX_Size added in v0.0.51

func (m *RetainedMessageMetadataList) XXX_Size() int

func (*RetainedMessageMetadataList) XXX_Unmarshal added in v0.0.51

func (m *RetainedMessageMetadataList) XXX_Unmarshal(b []byte) error

type RetainedMessageSet added in v0.0.39

type RetainedMessageSet []RetainedMessage

func (RetainedMessageSet) Apply added in v0.0.39

func (set RetainedMessageSet) Apply(f func(s RetainedMessage))

func (RetainedMessageSet) ApplyE added in v0.0.39

func (set RetainedMessageSet) ApplyE(f func(s RetainedMessage) error) error

func (RetainedMessageSet) ApplyIdx added in v0.0.39

func (set RetainedMessageSet) ApplyIdx(f func(idx int, s RetainedMessage))

func (RetainedMessageSet) Filter added in v0.0.39

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

type Store

type Store interface {
	Create(message *Metadata) error
	ByTopicPattern(tenant string, pattern []byte) (RetainedMessageMetadataList, error)
	All() (RetainedMessageMetadataList, 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