sessions

package
v0.0.63-rc42 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

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

Variables

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

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,proto3" json:"ID,omitempty"`
	Tenant               string   `protobuf:"bytes,2,opt,name=Tenant,proto3" json:"Tenant,omitempty"`
	Peer                 string   `protobuf:"bytes,3,opt,name=Peer,proto3" json:"Peer,omitempty"`
	WillTopic            []byte   `protobuf:"bytes,4,opt,name=WillTopic,proto3" json:"WillTopic,omitempty"`
	WillQoS              int32    `protobuf:"varint,5,opt,name=WillQoS,proto3" json:"WillQoS,omitempty"`
	WillPayload          []byte   `protobuf:"bytes,6,opt,name=WillPayload,proto3" json:"WillPayload,omitempty"`
	WillRetain           bool     `protobuf:"varint,7,opt,name=WillRetain,proto3" json:"WillRetain,omitempty"`
	Created              int64    `protobuf:"varint,8,opt,name=Created,proto3" json:"Created,omitempty"`
	ClientID             string   `protobuf:"bytes,9,opt,name=ClientID,proto3" json:"ClientID,omitempty"`
	LastAdded            int64    `protobuf:"varint,10,opt,name=LastAdded,proto3" json:"LastAdded,omitempty"`
	LastDeleted          int64    `protobuf:"varint,11,opt,name=LastDeleted,proto3" json:"LastDeleted,omitempty"`
	Transport            string   `protobuf:"bytes,12,opt,name=Transport,proto3" json:"Transport,omitempty"`
	RemoteAddress        string   `protobuf:"bytes,13,opt,name=RemoteAddress,proto3" json:"RemoteAddress,omitempty"`
	ClosureReason        string   `protobuf:"bytes,14,opt,name=ClosureReason,proto3" json:"ClosureReason,omitempty"`
	KeepaliveInterval    int32    `protobuf:"varint,15,opt,name=KeepaliveInterval,proto3" json:"KeepaliveInterval,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*Metadata) XXX_DiscardUnknown added in v0.0.51

func (m *Metadata) XXX_DiscardUnknown()

func (*Metadata) XXX_Marshal added in v0.0.51

func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Metadata) XXX_Merge added in v0.0.51

func (m *Metadata) XXX_Merge(src proto.Message)

func (*Metadata) XXX_Size added in v0.0.51

func (m *Metadata) XXX_Size() int

func (*Metadata) XXX_Unmarshal added in v0.0.51

func (m *Metadata) XXX_Unmarshal(b []byte) error

type RemoteTransportProvider added in v0.0.42

type RemoteTransportProvider func(id, peer 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,proto3" json:"Metadatas,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

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

func (*SessionMetadataList) XXX_DiscardUnknown added in v0.0.51

func (m *SessionMetadataList) XXX_DiscardUnknown()

func (*SessionMetadataList) XXX_Marshal added in v0.0.51

func (m *SessionMetadataList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SessionMetadataList) XXX_Merge added in v0.0.51

func (m *SessionMetadataList) XXX_Merge(src proto.Message)

func (*SessionMetadataList) XXX_Size added in v0.0.51

func (m *SessionMetadataList) XXX_Size() int

func (*SessionMetadataList) XXX_Unmarshal added in v0.0.51

func (m *SessionMetadataList) XXX_Unmarshal(b []byte) error

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
}

func NewSessionStore

func NewSessionStore(mesh types.ServiceLayer, remoteTransportProvider RemoteTransportProvider, logger Logger) (SessionStore, error)

type Transport added in v0.0.40

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

Jump to

Keyboard shortcuts

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