persistenceTypes

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: Apache-2.0 Imports: 0 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)
	Subscriptions() (Subscriptions, 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 Session

type Session interface {
	Get([]byte) (*SessionState, error)
}

Session persisted state of the session

type SessionState

type SessionState struct {
	Timestamp     string
	OutMessages   [][]byte
	UnAckMessages [][]byte
}

SessionState persisted session state

type Sessions

type Sessions interface {
	Load(func([]byte, *SessionState)) error
	Get([]byte) (*SessionState, error)
	PutOutMessage([]byte, []byte) error
	Store([]byte, *SessionState) error
	Delete([]byte) error
	Wipe() error
}

Sessions interface allows operating with sessions inside backend

type Subscriptions

type Subscriptions interface {
	Store([]byte, []byte) error
	Load(func([]byte, []byte) error) error
	Delete([]byte) error
	Wipe() error
}

Subscriptions interface within session

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