Documentation ¶
Overview ¶
Package subscriptions is a generated protocol buffer package.
It is generated from these files:
types.proto
It has these top-level messages:
Subscription SubscriptionList
Index ¶
- Constants
- Variables
- func IsOutdated(s *Subscription, remote *Subscription) (outdated bool)
- func TenantTopicIndexer() *topicIndexer
- type INode
- type Node
- type Store
- type Subscription
- func (*Subscription) Descriptor() ([]byte, []int)
- func (m *Subscription) GetID() string
- func (m *Subscription) GetLastAdded() int64
- func (m *Subscription) GetLastDeleted() int64
- func (m *Subscription) GetPattern() []byte
- func (m *Subscription) GetPeer() uint64
- func (m *Subscription) GetQos() int32
- func (m *Subscription) GetSessionID() string
- func (m *Subscription) GetTenant() string
- func (s *Subscription) IsAdded() bool
- func (s *Subscription) IsRemoved() bool
- func (*Subscription) ProtoMessage()
- func (m *Subscription) Reset()
- func (m *Subscription) String() string
- type SubscriptionFilter
- type SubscriptionList
- func (e *SubscriptionList) Append(entry state.Entry)
- func (set SubscriptionList) Apply(f func(*Subscription))
- func (set SubscriptionList) ApplyE(f func(*Subscription) error) (err error)
- func (set SubscriptionList) ApplyIdx(f func(idx int, s *Subscription))
- func (e *SubscriptionList) AtIndex(idx int) state.Entry
- func (*SubscriptionList) Descriptor() ([]byte, []int)
- func (set SubscriptionList) Filter(filters ...SubscriptionFilter) SubscriptionList
- func (m *SubscriptionList) GetSubscriptions() []*Subscription
- func (e *SubscriptionList) Length() int
- func (e *SubscriptionList) New() state.EntrySet
- func (*SubscriptionList) ProtoMessage()
- func (e *SubscriptionList) Range(f func(idx int, entry state.Entry))
- func (m *SubscriptionList) Reset()
- func (e *SubscriptionList) Set(idx int, entry state.Entry)
- func (m *SubscriptionList) String() string
- 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 IsOutdated ¶
func IsOutdated(s *Subscription, remote *Subscription) (outdated bool)
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 *SubscriptionList, topic Topic) *SubscriptionList
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 Store ¶
type Store interface { ByTopic(tenant string, pattern []byte) (*SubscriptionList, error) ByID(id string) (*Subscription, error) All() (SubscriptionList, error) ByPeer(peer uint64) (SubscriptionList, error) BySession(id string) (SubscriptionList, error) Sessions() ([]string, error) Create(message *Subscription) error Delete(id string) error On(event string, handler func(*Subscription)) func() }
type Subscription ¶
type Subscription 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 uint64 `protobuf:"varint,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 (*Subscription) Descriptor ¶
func (*Subscription) Descriptor() ([]byte, []int)
func (*Subscription) GetID ¶
func (m *Subscription) GetID() string
func (*Subscription) GetLastAdded ¶
func (m *Subscription) GetLastAdded() int64
func (*Subscription) GetLastDeleted ¶
func (m *Subscription) GetLastDeleted() int64
func (*Subscription) GetPattern ¶
func (m *Subscription) GetPattern() []byte
func (*Subscription) GetPeer ¶
func (m *Subscription) GetPeer() uint64
func (*Subscription) GetQos ¶
func (m *Subscription) GetQos() int32
func (*Subscription) GetSessionID ¶
func (m *Subscription) GetSessionID() string
func (*Subscription) GetTenant ¶
func (m *Subscription) GetTenant() string
func (*Subscription) IsAdded ¶
func (s *Subscription) IsAdded() bool
func (*Subscription) IsRemoved ¶
func (s *Subscription) IsRemoved() bool
func (*Subscription) ProtoMessage ¶
func (*Subscription) ProtoMessage()
func (*Subscription) Reset ¶
func (m *Subscription) Reset()
func (*Subscription) String ¶
func (m *Subscription) String() string
type SubscriptionFilter ¶
type SubscriptionFilter func(*Subscription) bool
type SubscriptionList ¶
type SubscriptionList struct {
Subscriptions []*Subscription `protobuf:"bytes,1,rep,name=Subscriptions" json:"Subscriptions,omitempty"`
}
func (*SubscriptionList) Append ¶
func (e *SubscriptionList) Append(entry state.Entry)
func (SubscriptionList) Apply ¶
func (set SubscriptionList) Apply(f func(*Subscription))
func (SubscriptionList) ApplyE ¶
func (set SubscriptionList) ApplyE(f func(*Subscription) error) (err error)
func (SubscriptionList) ApplyIdx ¶
func (set SubscriptionList) ApplyIdx(f func(idx int, s *Subscription))
func (*SubscriptionList) Descriptor ¶
func (*SubscriptionList) Descriptor() ([]byte, []int)
func (SubscriptionList) Filter ¶
func (set SubscriptionList) Filter(filters ...SubscriptionFilter) SubscriptionList
func (*SubscriptionList) GetSubscriptions ¶
func (m *SubscriptionList) GetSubscriptions() []*Subscription
func (*SubscriptionList) Length ¶
func (e *SubscriptionList) Length() int
func (*SubscriptionList) New ¶
func (e *SubscriptionList) New() state.EntrySet
func (*SubscriptionList) ProtoMessage ¶
func (*SubscriptionList) ProtoMessage()
func (*SubscriptionList) Range ¶
func (e *SubscriptionList) Range(f func(idx int, entry state.Entry))
func (*SubscriptionList) Reset ¶
func (m *SubscriptionList) Reset()
func (*SubscriptionList) String ¶
func (m *SubscriptionList) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.