bolt

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is a backend for writing and reading to bolt persistent storage.

func New

func New(path string, opts *bbolt.Options) *Store

New returns a configured instance of the boltdb store.

func (*Store) Close

func (s *Store) Close()

Close closes the boltdb instance.

func (*Store) DeleteClient

func (s *Store) DeleteClient(id string) error

DeleteClient deletes a client from the boltdb instance.

func (*Store) DeleteInflight

func (s *Store) DeleteInflight(cid string, pid uint16) error

DeleteInflight deletes an inflight message from the boltdb instance.

func (*Store) DeleteInflightBatch

func (s *Store) DeleteInflightBatch(cid string, pids []uint16) error

DeleteInflightBatch deletes inflight messages from the boltdb instance.

func (*Store) DeleteRetained

func (s *Store) DeleteRetained(topic string) error

DeleteRetained deletes a retained message from the boltdb instance.

func (*Store) DeleteSubscription

func (s *Store) DeleteSubscription(cid, filter string) error

DeleteSubscription deletes a subscription from the boltdb instance.

func (*Store) GenInflightId

func (s *Store) GenInflightId(cid string, pid uint16) string

func (*Store) GenRetainedId

func (s *Store) GenRetainedId(topic string) string

func (*Store) GenSubscriptionId

func (s *Store) GenSubscriptionId(cid, filter string) string

func (*Store) Open

func (s *Store) Open() error

Open opens the boltdb instance.

func (*Store) ReadClientByCid

func (s *Store) ReadClientByCid(cid string) (v persistence.Client, err error)

ReadClientByCid loads the client info from the boltdb instance.

func (*Store) ReadClients

func (s *Store) ReadClients() (v []persistence.Client, err error)

ReadClients loads all the clients from the boltdb instance.

func (*Store) ReadInflight

func (s *Store) ReadInflight() (v []persistence.Message, err error)

ReadInflight loads all the inflight messages from the boltdb instance.

func (*Store) ReadInflightByCid

func (s *Store) ReadInflightByCid(cid string) (v []persistence.Message, err error)

ReadInflightByCid loads all the inflight messages from the boltdb instance by the client id.

func (*Store) ReadRetained

func (s *Store) ReadRetained() (v []persistence.Message, err error)

ReadRetained loads all the retained messages from the boltdb instance.

func (*Store) ReadRetainedByTopic

func (s *Store) ReadRetainedByTopic(topic string) (v persistence.Message, err error)

ReadRetainedByTopic loads the retained message from the boltdb instance by the topic.

func (*Store) ReadServerInfo

func (s *Store) ReadServerInfo() (v persistence.ServerInfo, err error)

ReadServerInfo loads the server info from the boltdb instance.

func (*Store) ReadSubscriptions

func (s *Store) ReadSubscriptions() (v []persistence.Subscription, err error)

ReadSubscriptions loads all the subscriptions from the boltdb instance.

func (*Store) ReadSubscriptionsByCid

func (s *Store) ReadSubscriptionsByCid(cid string) (v []persistence.Subscription, err error)

ReadSubscriptionsByCid loads all the subscriptions from the boltdb instance by the client id.

func (*Store) WriteClient

func (s *Store) WriteClient(v persistence.Client) error

WriteClient writes a single client to the boltdb instance.

func (*Store) WriteInflight

func (s *Store) WriteInflight(v persistence.Message) error

WriteInflight writes a single inflight message to the boltdb instance.

func (*Store) WriteRetained

func (s *Store) WriteRetained(v persistence.Message) error

WriteRetained writes a single retained message to the boltdb instance.

func (*Store) WriteServerInfo

func (s *Store) WriteServerInfo(v persistence.ServerInfo) error

WriteServerInfo writes the server info to the boltdb instance.

func (*Store) WriteSubscription

func (s *Store) WriteSubscription(v persistence.Subscription) error

WriteSubscription writes a single subscription to the boltdb instance.

Jump to

Keyboard shortcuts

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