Documentation ¶
Overview ¶
Package store takes care of storing pending notifications.
Index ¶
- Constants
- Variables
- func InternalChannelIdToHex(chanId InternalChannelId) string
- type InMemoryPendingStore
- func (sto *InMemoryPendingStore) AppendToChannel(chanId InternalChannelId, notification json.RawMessage) error
- func (sto *InMemoryPendingStore) GetChannelSnapshot(chanId InternalChannelId) (int64, []json.RawMessage, error)
- func (sto *InMemoryPendingStore) GetInternalChannelId(name string) (InternalChannelId, error)
- type InternalChannelId
- type PendingStore
Constants ¶
View Source
const SystemInternalChannelId = InternalChannelId("0")
Variables ¶
View Source
var ErrExpected128BitsHexRepr = errors.New("expected 128 bits hex repr")
View Source
var ErrFull = errors.New("channel is full")
View Source
var ErrUnknownChannel = errors.New("unknown channel name")
Functions ¶
func InternalChannelIdToHex ¶
func InternalChannelIdToHex(chanId InternalChannelId) string
Types ¶
type InMemoryPendingStore ¶
type InMemoryPendingStore struct {
// contains filtered or unexported fields
}
InMemoryPendingStore is a basic in-memory pending notification store.
func NewInMemoryPendingStore ¶
func NewInMemoryPendingStore() *InMemoryPendingStore
NewInMemoryPendingStore returns a new InMemoryStore.
func (*InMemoryPendingStore) AppendToChannel ¶
func (sto *InMemoryPendingStore) AppendToChannel(chanId InternalChannelId, notification json.RawMessage) error
func (*InMemoryPendingStore) GetChannelSnapshot ¶
func (sto *InMemoryPendingStore) GetChannelSnapshot(chanId InternalChannelId) (int64, []json.RawMessage, error)
func (*InMemoryPendingStore) GetInternalChannelId ¶
func (sto *InMemoryPendingStore) GetInternalChannelId(name string) (InternalChannelId, error)
type InternalChannelId ¶
type InternalChannelId string
func HexToInternalChannelId ¶
func HexToInternalChannelId(hexRepr string) (InternalChannelId, error)
type PendingStore ¶
type PendingStore interface { // GetInternalChannelId returns the internal store id for a channel // given the name. GetInternalChannelId(name string) (InternalChannelId, error) // AppendToChannel appends a notification to the channel. xxx expiration AppendToChannel(chanId InternalChannelId, notification json.RawMessage) error // GetChannelSnapshot gets all the current notifications and // current top level in the channel. GetChannelSnapshot(chanId InternalChannelId) (topLevel int64, payloads []json.RawMessage, err error) }
PendingStore let store notifications into channels.
Click to show internal directories.
Click to hide internal directories.