mem

package
v0.0.0-...-68b20d9 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TrieDB

type TrieDB struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

TrieDB implement the subscription.Interface, it use trie tree to store topics.

func NewStore

func NewStore() *TrieDB

NewStore create a new TrieDB instance

func (*TrieDB) Close

func (db *TrieDB) Close() error

func (*TrieDB) GetClientStats

func (db *TrieDB) GetClientStats(clientID string) (subscription.Stats, error)

func (*TrieDB) GetClientStatsLocked

func (db *TrieDB) GetClientStatsLocked(clientID string) (subscription.Stats, error)

GetClientStatsLocked the non thread-safe version of GetClientStats

func (*TrieDB) GetStats

func (db *TrieDB) GetStats() subscription.Stats

GetStats returns the statistic information of the store

func (*TrieDB) GetStatusLocked

func (db *TrieDB) GetStatusLocked() subscription.Stats

GetStats is the non thread-safe version of GetStats

func (*TrieDB) Init

func (db *TrieDB) Init(clientIDs []string) error

func (*TrieDB) Iterate

func (db *TrieDB) Iterate(fn subscription.IterateFn, options subscription.IterationOptions)

func (*TrieDB) IterateLocked

func (db *TrieDB) IterateLocked(fn subscription.IterateFn, options subscription.IterationOptions)

IterateLocked is the non thread-safe version of Iterate

func (*TrieDB) Subscribe

func (db *TrieDB) Subscribe(clientID string, subscriptions ...*gmqtt.Subscription) (subscription.SubscribeResult, error)

SubscribeLocked add subscriptions for the client

func (*TrieDB) SubscribeLocked

func (db *TrieDB) SubscribeLocked(clientID string, subscriptions ...*gmqtt.Subscription) subscription.SubscribeResult

SubscribeLocked is the non thread-safe version of Subscribe

func (*TrieDB) Unsubscribe

func (db *TrieDB) Unsubscribe(clientID string, topics ...string) error

Unsubscribe remove subscriptions for the client

func (*TrieDB) UnsubscribeAll

func (db *TrieDB) UnsubscribeAll(clientID string) error

UnsubscribeAll delete all subscriptions of the client

func (*TrieDB) UnsubscribeAllLocked

func (db *TrieDB) UnsubscribeAllLocked(clientID string)

UnsubscribeAllLocked is the non thread-safe version of UnsubscribeAll

func (*TrieDB) UnsubscribeLocked

func (db *TrieDB) UnsubscribeLocked(clientID string, topics ...string)

UnsubscribeLocked is the non thread-safe version of Unsubscribe

Jump to

Keyboard shortcuts

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