Documentation ¶
Index ¶
- func Close() error
- func GetAdapterName() string
- func IsOpen() bool
- func Open(path string, size int64, reset bool) error
- func RegisterAdapter(name string, l adapter.Adapter)
- type MessageLog
- func (l *MessageLog) Delete(key uint64)
- func (l *MessageLog) Get(key uint64) lp.MessagePack
- func (l *MessageLog) Keys(prefix uint32) []uint64
- func (l *MessageLog) PersistInbound(blockID uint32, inMsg lp.MessagePack)
- func (l *MessageLog) PersistOutbound(blockID uint32, outMsg lp.MessagePack)
- func (l *MessageLog) Reset(prefix uint32)
- type SessionStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAdapterName ¶
func GetAdapterName() string
GetAdapterName returns the name of the current adater.
func IsOpen ¶
func IsOpen() bool
IsOpen checks if persistent storage connection has been initialized.
func Open ¶
Open initializes the persistence. Adapter holds a connection pool for a database instance.
path - database path
func RegisterAdapter ¶
RegisterAdapter makes a persistence adapter available. If Register is called twice or if the adapter is nil, it panics.
Types ¶
type MessageLog ¶
type MessageLog struct{}
MessageLog is a Message struct to hold methods for persistence mapping for the Message object.
var Log MessageLog
Log is the anchor for storing/retrieving Message objects
func (*MessageLog) Delete ¶
func (l *MessageLog) Delete(key uint64)
Delete is used to delete message.
func (*MessageLog) Get ¶
func (l *MessageLog) Get(key uint64) lp.MessagePack
Get performs a query and attempts to fetch message for the given key
func (*MessageLog) Keys ¶
func (l *MessageLog) Keys(prefix uint32) []uint64
Keys performs a query and attempts to fetch all keys that matches prefix.
func (*MessageLog) PersistInbound ¶
func (l *MessageLog) PersistInbound(blockID uint32, inMsg lp.MessagePack)
handle which incoming messages are stored
func (*MessageLog) PersistOutbound ¶
func (l *MessageLog) PersistOutbound(blockID uint32, outMsg lp.MessagePack)
handle which outgoing messages are stored
func (*MessageLog) Reset ¶
func (l *MessageLog) Reset(prefix uint32)
Reset removes all keys with the prefix from the store.
type SessionStore ¶
type SessionStore struct{}
SessionStore is a Session struct to hold methods for persistence mapping for the Session object.
var Session SessionStore
Session is the anchor for storing/retrieving Session objects