persistenceTypes

package
Version: v0.0.2-beta Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDBConfig

type BoltDBConfig struct {
	File string
}

BoltDBConfig configuration of the BoltDB backend

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
)

func (Errors) Error

func (e Errors) Error() string

Errors description during persistence

type MemConfig

type MemConfig struct{}

MemConfig configuration of the in memory backend

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([][]byte) error
	// Load load retained messages
	Load() ([][]byte, error)
	// Wipe retained storage
	Wipe() error
}

Retained provider for load/store retained messages

type SessionMessages

type SessionMessages struct {
	OutMessages   [][]byte
	UnAckMessages [][]byte
}

SessionMessages persisted session messages

type SessionState

type SessionState struct {
	Timestamp string
	ExpireIn  *time.Duration
	Will      *SessionWill
	Version   packet.ProtocolVersion
}

SessionState object

type SessionWill

type SessionWill struct {
	Delay   time.Duration
	Message []byte
}

SessionWill object

type Sessions

type Sessions interface {
	StatesIterate(func([]byte, *SessionState) error) error
	StateStore([]byte, *SessionState) error
	StateWipe([]byte) error
	StatesWipe() error

	MessagesLoad([]byte) (*SessionMessages, error)
	MessagesStore([]byte, *SessionMessages) error
	MessageStore([]byte, []byte) error
	MessagesWipe([]byte) error

	SubscriptionsIterate(func([]byte, []byte) error) error
	SubscriptionStore([]byte, []byte) error
	SubscriptionDelete([]byte) error
	SubscriptionsWipe() error

	Delete([]byte) error
}

Sessions interface allows operating with sessions inside backend

type System

type System interface {
	GetInfo() (*SystemState, error)
	SetInfo(*SystemState) error
}

System persistence state of the system configuration

type SystemState

type SystemState struct {
	Version  string
	NodeName string
}

SystemState system configuration

Jump to

Keyboard shortcuts

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