Documentation ¶
Overview ¶
Package subscriptions is a generated protocol buffer package.
It is generated from these files:
types.proto
It has these top-level messages:
Metadata SubscriptionMetadataList
Index ¶
- Constants
- Variables
- func TenantTopicIndexer() *topicIndexer
- type Channel
- type INode
- type Metadata
- func (*Metadata) Descriptor() ([]byte, []int)
- func (m *Metadata) GetID() string
- func (m *Metadata) GetLastAdded() int64
- func (m *Metadata) GetLastDeleted() int64
- func (m *Metadata) GetPattern() []byte
- func (m *Metadata) GetPeer() string
- func (m *Metadata) GetQos() int32
- func (m *Metadata) GetSessionID() string
- func (m *Metadata) GetTenant() string
- func (*Metadata) ProtoMessage()
- func (m *Metadata) Reset()
- func (m *Metadata) String() string
- type Node
- type RemoteSender
- type Store
- type Subscription
- type SubscriptionFilter
- type SubscriptionMetadataList
- type SubscriptionSet
- type Topic
Constants ¶
View Source
const ( SubscriptionCreated string = "subscription_created" SubscriptionDeleted string = "subscription_deleted" )
Variables ¶
View Source
var (
ErrSubscriptionNotFound = errors.New("subscription not found")
)
View Source
var (
SEP = byte('/')
)
Functions ¶
func TenantTopicIndexer ¶
func TenantTopicIndexer() *topicIndexer
Types ¶
type INode ¶
type INode struct {
// contains filtered or unexported fields
}
func (*INode) Insert ¶
func (d *INode) Insert(topic Topic, tenant string, subscription Subscription)
func (*INode) Select ¶
func (d *INode) Select(tenant string, set SubscriptionSet, topic Topic) SubscriptionSet
type Metadata ¶ added in v0.0.39
type Metadata struct { ID string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"` SessionID string `protobuf:"bytes,2,opt,name=SessionID" json:"SessionID,omitempty"` Tenant string `protobuf:"bytes,3,opt,name=Tenant" json:"Tenant,omitempty"` Pattern []byte `protobuf:"bytes,4,opt,name=Pattern,proto3" json:"Pattern,omitempty"` Qos int32 `protobuf:"varint,5,opt,name=Qos" json:"Qos,omitempty"` Peer string `protobuf:"bytes,6,opt,name=Peer" json:"Peer,omitempty"` LastAdded int64 `protobuf:"varint,7,opt,name=LastAdded" json:"LastAdded,omitempty"` LastDeleted int64 `protobuf:"varint,8,opt,name=LastDeleted" json:"LastDeleted,omitempty"` }
func (*Metadata) Descriptor ¶ added in v0.0.39
func (*Metadata) GetLastAdded ¶ added in v0.0.39
func (*Metadata) GetLastDeleted ¶ added in v0.0.39
func (*Metadata) GetPattern ¶ added in v0.0.39
func (*Metadata) GetSessionID ¶ added in v0.0.39
func (*Metadata) ProtoMessage ¶ added in v0.0.39
func (*Metadata) ProtoMessage()
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) AddSubscription ¶
func (n *Node) AddSubscription(tenant string, subscription Subscription) *Node
func (*Node) DelSubscription ¶
type RemoteSender ¶ added in v0.0.39
type Store ¶
type Store interface { ByTopic(tenant string, pattern []byte) (SubscriptionSet, error) ByID(id string) (Subscription, error) All() (SubscriptionSet, error) ByPeer(peer string) (SubscriptionSet, error) BySession(id string) (SubscriptionSet, error) Sessions() ([]string, error) Create(message Subscription, sender func(packet.Publish) error) error Delete(id string) error On(event string, handler func(Subscription)) func() }
func NewMemDBStore ¶
func NewMemDBStore(mesh cluster.Mesh, sender RemoteSender) (Store, error)
type SubscriptionFilter ¶
type SubscriptionFilter func(Subscription) bool
type SubscriptionMetadataList ¶ added in v0.0.39
type SubscriptionMetadataList struct {
Metadatas []*Metadata `protobuf:"bytes,1,rep,name=Metadatas" json:"Metadatas,omitempty"`
}
func (*SubscriptionMetadataList) Descriptor ¶ added in v0.0.39
func (*SubscriptionMetadataList) Descriptor() ([]byte, []int)
func (*SubscriptionMetadataList) GetMetadatas ¶ added in v0.0.39
func (m *SubscriptionMetadataList) GetMetadatas() []*Metadata
func (*SubscriptionMetadataList) ProtoMessage ¶ added in v0.0.39
func (*SubscriptionMetadataList) ProtoMessage()
func (*SubscriptionMetadataList) Reset ¶ added in v0.0.39
func (m *SubscriptionMetadataList) Reset()
func (*SubscriptionMetadataList) String ¶ added in v0.0.39
func (m *SubscriptionMetadataList) String() string
type SubscriptionSet ¶ added in v0.0.39
type SubscriptionSet []Subscription
func (SubscriptionSet) Apply ¶ added in v0.0.39
func (set SubscriptionSet) Apply(f func(Subscription))
func (SubscriptionSet) ApplyE ¶ added in v0.0.39
func (set SubscriptionSet) ApplyE(f func(Subscription) error) (err error)
func (SubscriptionSet) ApplyIdx ¶ added in v0.0.39
func (set SubscriptionSet) ApplyIdx(f func(idx int, s Subscription))
func (SubscriptionSet) Filter ¶ added in v0.0.39
func (set SubscriptionSet) Filter(filters ...SubscriptionFilter) SubscriptionSet
Source Files ¶
Click to show internal directories.
Click to hide internal directories.