-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathalias.go
More file actions
23 lines (20 loc) · 835 Bytes
/
alias.go
File metadata and controls
23 lines (20 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package courier
import (
mqtt "github.com/gojek/paho.mqtt.golang"
)
// Store is an interface which can be used to provide implementations
// for message persistence.
//
// [IMPORTANT]
// When implementing a store with a shared storage (ex: redis) across multiple
// application instances, it should be ensured that the keys are namespaced for
// each application instance otherwise there will be collisions.
// The messages are identified based on message id from the MQTT packets, and they have values
// in range (0, 2^16), this coincides with max number of in-flight messages
type Store = mqtt.Store
// NewMemoryStore returns a pointer to a new instance of
// mqtt.MemoryStore, the instance is not initialized and ready to
// use until Open() has been called on it.
func NewMemoryStore() Store {
return mqtt.NewMemoryStore()
}