Documentation ¶
Index ¶
- func Close() error
- func GetAdapterName() string
- func InitDb(jsonconf string, reset bool) error
- func InitMessageStore(ctx context.Context, reset bool) error
- func IsOpen() bool
- func Open(jsonconf string) error
- func RegisterAdapter(name string, a adapter.Adapter)
- type MessageLog
- func (l *MessageLog) Delete(key uint64)
- func (l *MessageLog) Get(proto lp.ProtoAdapter, key uint64) lp.Packet
- func (l *MessageLog) Keys(prefix uint32) []uint64
- func (l *MessageLog) PersistInbound(proto lp.ProtoAdapter, blockId, key uint64, msg lp.Packet)
- func (l *MessageLog) PersistOutbound(proto lp.ProtoAdapter, blockId, key uint64, msg lp.Packet)
- func (l *MessageLog) Reset(prefix uint32)
- type MessageStore
- type SubscriptionStore
- func (s *SubscriptionStore) Delete(contract uint32, messageId, topic []byte) error
- func (s *SubscriptionStore) Get(contract uint32, topic []byte) (matches [][]byte, err error)
- func (s *SubscriptionStore) NewID() ([]byte, error)
- func (s *SubscriptionStore) Put(contract uint32, messageId, topic, payload []byte) error
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 InitDb ¶
InitDb open the db connection. If jsconf is nil it will assume that the connection is already open. If it's non-nil, it will use the config string to open the DB connection first.
func InitMessageStore ¶
InitMessageStore init message store and start recovery if reset flag is not set.
func IsOpen ¶
func IsOpen() bool
IsOpen checks if persistent storage connection has been initialized.
func Open ¶
Open initializes the persistence system. Adapter holds a connection pool for a database instance.
name - name of the adapter rquested in the config file jsonconf - configuration string
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(proto lp.ProtoAdapter, key uint64) lp.Packet
Get performs a query and attempts to fetch message for the given blockId and key
func (*MessageLog) Keys ¶
func (l *MessageLog) Keys(prefix uint32) []uint64
Keys performs a query and attempts to fetch all keys for given blockId and key prefix.
func (*MessageLog) PersistInbound ¶
func (l *MessageLog) PersistInbound(proto lp.ProtoAdapter, blockId, key uint64, msg lp.Packet)
PersistInbound handles which incoming messages are stored
func (*MessageLog) PersistOutbound ¶
func (l *MessageLog) PersistOutbound(proto lp.ProtoAdapter, blockId, key uint64, msg lp.Packet)
PersistOutbound handles which outgoing messages are stored
func (*MessageLog) Reset ¶
func (l *MessageLog) Reset(prefix uint32)
Reset removes all keys from store for the given blockId and key prefix
type MessageStore ¶
type MessageStore struct{}
MessageStore is a Message struct to hold methods for persistence mapping for the Message object.
var Message MessageStore
Message is the anchor for storing/retrieving Message objects
type SubscriptionStore ¶
type SubscriptionStore struct{}
SubscriptionStore is a Subscription struct to hold methods for persistence mapping for the subscription. Note, do not use same contract as messagestore
var Subscription SubscriptionStore
Message is the ancor for storing/retrieving Message objects
func (*SubscriptionStore) Delete ¶
func (s *SubscriptionStore) Delete(contract uint32, messageId, topic []byte) error
func (*SubscriptionStore) Get ¶
func (s *SubscriptionStore) Get(contract uint32, topic []byte) (matches [][]byte, err error)
func (*SubscriptionStore) NewID ¶
func (s *SubscriptionStore) NewID() ([]byte, error)