Documentation ¶
Index ¶
- Variables
- type Store
- func (s *Store) ClearExpiredInflight(expiry int64) error
- func (s *Store) Close()
- func (s *Store) DeleteClient(id string) error
- func (s *Store) DeleteInflight(id string) error
- func (s *Store) DeleteRetained(id string) error
- func (s *Store) DeleteSubscription(id string) error
- func (s *Store) Open() error
- func (s *Store) ReadClients() (v []persistence.Client, err error)
- func (s *Store) ReadInflight() (v []persistence.Message, err error)
- func (s *Store) ReadRetained() (v []persistence.Message, err error)
- func (s *Store) ReadServerInfo() (v persistence.ServerInfo, err error)
- func (s *Store) ReadSubscriptions() (v []persistence.Subscription, err error)
- func (s *Store) SetInflightTTL(seconds int64)
- func (s *Store) WriteClient(v persistence.Client) error
- func (s *Store) WriteInflight(v persistence.Message) error
- func (s *Store) WriteRetained(v persistence.Message) error
- func (s *Store) WriteServerInfo(v persistence.ServerInfo) error
- func (s *Store) WriteSubscription(v persistence.Subscription) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDBNotOpen indicates the bolt db file is not open for reading. ErrDBNotOpen = fmt.Errorf("boltdb not opened") )
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 (*Store) ClearExpiredInflight ¶
ClearExpiredInflight deletes any inflight messages older than the provided unix timestamp.
func (*Store) DeleteClient ¶
DeleteClient deletes a client from the boltdb instance.
func (*Store) DeleteInflight ¶
DeleteInflight deletes an inflight message from the boltdb instance.
func (*Store) DeleteRetained ¶
DeleteRetained deletes a retained message from the boltdb instance.
func (*Store) DeleteSubscription ¶
DeleteSubscription deletes a subscription 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) ReadRetained ¶
func (s *Store) ReadRetained() (v []persistence.Message, err error)
ReadRetained loads all the retained messages from the boltdb instance.
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) SetInflightTTL ¶
SetInflightTTL sets the number of seconds an inflight message should be kept before being dropped, in the event it is not delivered. Unless you have a good reason, you should allow this to be called by the server (in AddStore) instead of directly.
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.