sessions

package
v0.0.23 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: 9 Imported by: 0

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

View Source
const (
	SessionCreated string = "session_created"
	SessionDeleted string = "session_deleted"
)

Variables

View Source
var (
	ErrSessionNotFound = errors.New("session not found")
)

Functions

func IsOutdated

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

Types

type Router

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

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) Descriptor() ([]byte, []int)

func (*Session) GetClientID

func (m *Session) GetClientID() []byte

func (*Session) GetClosureReason added in v0.0.15

func (m *Session) GetClosureReason() string

func (*Session) GetCreated

func (m *Session) GetCreated() int64

func (*Session) GetID

func (m *Session) GetID() string

func (*Session) GetLastAdded

func (m *Session) GetLastAdded() int64

func (*Session) GetLastDeleted

func (m *Session) GetLastDeleted() int64

func (*Session) GetPeer

func (m *Session) GetPeer() uint64

func (*Session) GetRemoteAddress added in v0.0.10

func (m *Session) GetRemoteAddress() string

func (*Session) GetTenant

func (m *Session) GetTenant() string

func (*Session) GetTransport

func (m *Session) GetTransport() string

func (*Session) GetWillPayload

func (m *Session) GetWillPayload() []byte

func (*Session) GetWillQoS

func (m *Session) GetWillQoS() int32

func (*Session) GetWillRetain

func (m *Session) GetWillRetain() bool

func (*Session) GetWillTopic

func (m *Session) GetWillTopic() []byte

func (*Session) IsAdded

func (s *Session) IsAdded() bool

func (*Session) IsRemoved

func (s *Session) IsRemoved() bool

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) Reset

func (m *Session) Reset()

func (*Session) String

func (m *Session) String() string

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) ApplyE

func (set SessionList) ApplyE(f func(s *Session) error) error

func (SessionList) ApplyIdx

func (set SessionList) ApplyIdx(f func(idx int, s *Session))

func (*SessionList) AtIndex

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

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) Range

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

func (*SessionList) Reset

func (m *SessionList) Reset()

func (*SessionList) Set

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

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)

Jump to

Keyboard shortcuts

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