sessions

package
v0.0.51-rc4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: MPL-2.0 Imports: 12 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:

Metadata
SessionMetadataList

Index

Constants

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

Variables

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

Functions

This section is empty.

Types

type Channel added in v0.0.37

type Channel interface {
	Broadcast([]byte)
}

type Logger added in v0.0.39

type Logger interface {
	Printf(string, ...interface{})
}

type Metadata added in v0.0.39

type Metadata struct {
	ID                string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	Tenant            string `protobuf:"bytes,2,opt,name=Tenant" json:"Tenant,omitempty"`
	Peer              string `protobuf:"bytes,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          string `protobuf:"bytes,9,opt,name=ClientID" 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"`
	KeepaliveInterval int32  `protobuf:"varint,15,opt,name=KeepaliveInterval" json:"KeepaliveInterval,omitempty"`
}

func (*Metadata) Descriptor added in v0.0.39

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

func (*Metadata) GetClientID added in v0.0.39

func (m *Metadata) GetClientID() string

func (*Metadata) GetClosureReason added in v0.0.39

func (m *Metadata) GetClosureReason() string

func (*Metadata) GetCreated added in v0.0.39

func (m *Metadata) GetCreated() int64

func (*Metadata) GetID added in v0.0.39

func (m *Metadata) GetID() string

func (*Metadata) GetKeepaliveInterval added in v0.0.39

func (m *Metadata) GetKeepaliveInterval() int32

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) GetPeer added in v0.0.39

func (m *Metadata) GetPeer() string

func (*Metadata) GetRemoteAddress added in v0.0.39

func (m *Metadata) GetRemoteAddress() string

func (*Metadata) GetTenant added in v0.0.39

func (m *Metadata) GetTenant() string

func (*Metadata) GetTransport added in v0.0.39

func (m *Metadata) GetTransport() string

func (*Metadata) GetWillPayload added in v0.0.39

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

func (*Metadata) GetWillQoS added in v0.0.39

func (m *Metadata) GetWillQoS() int32

func (*Metadata) GetWillRetain added in v0.0.39

func (m *Metadata) GetWillRetain() bool

func (*Metadata) GetWillTopic added in v0.0.39

func (m *Metadata) GetWillTopic() []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

type RemoteTransportProvider added in v0.0.42

type RemoteTransportProvider func(peer, session string) Transport

type Session

type Session struct {
	Metadata

	Transport Transport
	// contains filtered or unexported fields
}

type SessionMetadataList added in v0.0.39

type SessionMetadataList struct {
	Metadatas []*Metadata `protobuf:"bytes,1,rep,name=Metadatas" json:"Metadatas,omitempty"`
}

func (*SessionMetadataList) Descriptor added in v0.0.39

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

func (*SessionMetadataList) GetMetadatas added in v0.0.39

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

func (*SessionMetadataList) ProtoMessage added in v0.0.39

func (*SessionMetadataList) ProtoMessage()

func (*SessionMetadataList) Reset added in v0.0.39

func (m *SessionMetadataList) Reset()

func (*SessionMetadataList) String added in v0.0.39

func (m *SessionMetadataList) String() string

type SessionSet added in v0.0.39

type SessionSet []Session

func (SessionSet) Apply added in v0.0.39

func (set SessionSet) Apply(f func(s Session))

func (SessionSet) ApplyE added in v0.0.39

func (set SessionSet) ApplyE(f func(s Session) error) error

func (SessionSet) ApplyIdx added in v0.0.39

func (set SessionSet) ApplyIdx(f func(idx int, s Session))

func (SessionSet) Filter added in v0.0.39

func (set SessionSet) Filter(filters ...sessionFilter) SessionSet

type SessionStore

type SessionStore interface {
	ByID(id string) (Session, error)
	ByClientID(id string) (SessionSet, error)
	ByPeer(peer string) (SessionSet, error)
	All() (SessionSet, error)
	Exists(id string) bool
	Delete(id, reason string) error
	Upsert(sess Session, Transport Transport) error
	On(event string, handler func(Session)) func()
}

func NewSessionStore

func NewSessionStore(mesh cluster.Mesh, remoteTransportProvider RemoteTransportProvider, logger Logger) (SessionStore, error)

type Transport added in v0.0.40

type Transport interface {
	Close() error
	Publish(*packet.Publish) error
}

Jump to

Keyboard shortcuts

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