Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Errors ¶
type Errors int
Errors persistence errors
const ( // ErrInvalidArgs invalid arguments provided ErrInvalidArgs Errors = iota // ErrUnknownProvider if provider is unknown ErrUnknownProvider // ErrAlreadyExists object already exists ErrAlreadyExists // ErrNotInitialized persistence provider not initialized yet ErrNotInitialized // ErrNotFound object not found ErrNotFound // ErrNotOpen storage is not open ErrNotOpen // ErrBrokenEntry persisted entry does not meet requirements ErrBrokenEntry )
type Packets ¶
type Packets interface { PacketsForEach([]byte, func(PersistedPacket) error) error PacketsStore([]byte, []PersistedPacket) error }
Packets interface for connection to handle packets
type PersistedPacket ¶
PersistedPacket wraps packet to handle misc cases like expiration
type Provider ¶
type Provider interface { Sessions() (Sessions, error) Retained() (Retained, error) System() (System, error) Shutdown() error }
Provider interface implemented by different backends
type ProviderConfig ¶
type ProviderConfig interface{}
ProviderConfig interface implemented by every backend
type Retained ¶
type Retained interface { // Store persist retained message Store([]PersistedPacket) error // Load load retained messages Load() ([]PersistedPacket, error) // Wipe retained storage Wipe() error }
Retained provider for load/store retained messages
type SessionDelays ¶
SessionDelays formerly known as expiry set timestamp to handle will delay and/or expiration
type SessionState ¶
type SessionState struct { Subscriptions []byte Timestamp string Errors []error Expire *SessionDelays Version byte }
SessionState object
type Sessions ¶
type Sessions interface { Packets Subscriptions State LoadForEach(func([]byte, *SessionState) error) error PacketStore([]byte, PersistedPacket) error PacketsDelete([]byte) error Exists(id []byte) bool Delete([]byte) error }
Sessions interface allows operating with sessions inside backend
type State ¶
type State interface { StateStore([]byte, *SessionState) error StateDelete([]byte) error }
State session state interface
type Subscriptions ¶
type Subscriptions interface { SubscriptionsStore([]byte, []byte) error SubscriptionsDelete([]byte) error }
Subscriptions session subscriptions interface
type System ¶
type System interface { GetInfo() (*SystemState, error) SetInfo(*SystemState) error }
System persistence state of the system configuration
type SystemState ¶
SystemState system configuration