Documentation ¶
Overview ¶
Package sessions is a generated protocol buffer package.
It is generated from these files:
types.proto
It has these top-level messages:
Session SessionList
Index ¶
- Constants
- Variables
- func IsOutdated(s *Session, remote *Session) (outdated bool)
- type Router
- type Session
- func (*Session) Descriptor() ([]byte, []int)
- func (m *Session) GetClientID() []byte
- func (m *Session) GetClosureReason() string
- func (m *Session) GetCreated() int64
- func (m *Session) GetID() string
- func (m *Session) GetLastAdded() int64
- func (m *Session) GetLastDeleted() int64
- func (m *Session) GetPeer() uint64
- func (m *Session) GetRemoteAddress() string
- func (m *Session) GetTenant() string
- func (m *Session) GetTransport() string
- func (m *Session) GetWillPayload() []byte
- func (m *Session) GetWillQoS() int32
- func (m *Session) GetWillRetain() bool
- func (m *Session) GetWillTopic() []byte
- func (s *Session) IsAdded() bool
- func (s *Session) IsRemoved() bool
- func (*Session) ProtoMessage()
- func (m *Session) Reset()
- func (m *Session) String() string
- type SessionList
- func (e *SessionList) Append(entry state.Entry)
- func (set SessionList) Apply(f func(s *Session))
- func (set SessionList) ApplyE(f func(s *Session) error) error
- func (set SessionList) ApplyIdx(f func(idx int, s *Session))
- func (e *SessionList) AtIndex(idx int) state.Entry
- func (*SessionList) Descriptor() ([]byte, []int)
- func (set SessionList) Filter(filters ...sessionFilter) SessionList
- func (m *SessionList) GetSessions() []*Session
- func (e *SessionList) Length() int
- func (e *SessionList) New() state.EntrySet
- func (*SessionList) ProtoMessage()
- func (e *SessionList) Range(f func(idx int, entry state.Entry))
- func (m *SessionList) Reset()
- func (e *SessionList) Set(idx int, entry state.Entry)
- func (m *SessionList) String() string
- type SessionStore
Constants ¶
View Source
const ( SessionCreated string = "session_created" SessionDeleted string = "session_deleted" )
Variables ¶
View Source
var (
ErrSessionNotFound = errors.New("session not found")
)
Functions ¶
func IsOutdated ¶
Types ¶
type Session ¶
type Session struct { ID string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"` Tenant string `protobuf:"bytes,2,opt,name=Tenant" json:"Tenant,omitempty"` Peer uint64 `protobuf:"varint,3,opt,name=Peer" json:"Peer,omitempty"` WillTopic []byte `protobuf:"bytes,4,opt,name=WillTopic,proto3" json:"WillTopic,omitempty"` WillQoS int32 `protobuf:"varint,5,opt,name=WillQoS" json:"WillQoS,omitempty"` WillPayload []byte `protobuf:"bytes,6,opt,name=WillPayload,proto3" json:"WillPayload,omitempty"` WillRetain bool `protobuf:"varint,7,opt,name=WillRetain" json:"WillRetain,omitempty"` Created int64 `protobuf:"varint,8,opt,name=Created" json:"Created,omitempty"` ClientID []byte `protobuf:"bytes,9,opt,name=ClientID,proto3" json:"ClientID,omitempty"` LastAdded int64 `protobuf:"varint,10,opt,name=LastAdded" json:"LastAdded,omitempty"` LastDeleted int64 `protobuf:"varint,11,opt,name=LastDeleted" json:"LastDeleted,omitempty"` Transport string `protobuf:"bytes,12,opt,name=Transport" json:"Transport,omitempty"` RemoteAddress string `protobuf:"bytes,13,opt,name=RemoteAddress" json:"RemoteAddress,omitempty"` ClosureReason string `protobuf:"bytes,14,opt,name=ClosureReason" json:"ClosureReason,omitempty"` }
func (*Session) Descriptor ¶
func (*Session) GetClientID ¶
func (*Session) GetClosureReason ¶ added in v0.0.15
func (*Session) GetCreated ¶
func (*Session) GetLastAdded ¶
func (*Session) GetLastDeleted ¶
func (*Session) GetRemoteAddress ¶ added in v0.0.10
func (*Session) GetTransport ¶
func (*Session) GetWillPayload ¶
func (*Session) GetWillQoS ¶
func (*Session) GetWillRetain ¶
func (*Session) GetWillTopic ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
type SessionList ¶
type SessionList struct {
Sessions []*Session `protobuf:"bytes,1,rep,name=Sessions" json:"Sessions,omitempty"`
}
func (*SessionList) Append ¶
func (e *SessionList) Append(entry state.Entry)
func (SessionList) Apply ¶
func (set SessionList) Apply(f func(s *Session))
func (SessionList) ApplyIdx ¶
func (set SessionList) ApplyIdx(f func(idx int, s *Session))
func (*SessionList) Descriptor ¶
func (*SessionList) Descriptor() ([]byte, []int)
func (SessionList) Filter ¶
func (set SessionList) Filter(filters ...sessionFilter) SessionList
func (*SessionList) GetSessions ¶
func (m *SessionList) GetSessions() []*Session
func (*SessionList) Length ¶
func (e *SessionList) Length() int
func (*SessionList) New ¶
func (e *SessionList) New() state.EntrySet
func (*SessionList) ProtoMessage ¶
func (*SessionList) ProtoMessage()
func (*SessionList) Reset ¶
func (m *SessionList) Reset()
func (*SessionList) String ¶
func (m *SessionList) String() string
type SessionStore ¶
type SessionStore interface { ByID(id string) (*Session, error) ByPeer(peer uint64) (SessionList, error) All() (SessionList, error) Exists(id string) bool Upsert(sess *Session) error Delete(id, reason string) error On(event string, handler func(*Session)) func() }
func NewSessionStore ¶
func NewSessionStore(router Router) (SessionStore, error)
Click to show internal directories.
Click to hide internal directories.