Documentation ¶
Index ¶
- type HTTP
- type InMemory
- func (s *InMemory) Close() error
- func (s *InMemory) Configure(config map[string]interface{}) error
- func (s *InMemory) Name() string
- func (s *InMemory) OnRequest(queryType string, payload []byte) ([]byte, bool)
- func (s *InMemory) QueryLast(ssid []uint32, limit int) (<-chan []byte, error)
- func (s *InMemory) Store(m *message.Message) error
- type Noop
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTP ¶
HTTP represents a storage which uses HTTP requests to store/retrieve messages.
func (*HTTP) Close ¶
Close gracefully terminates the storage and ensures that every related resource is properly disposed.
func (*HTTP) Configure ¶
Configure configures the storage. The config parameter provided is loosely typed, since various storage mechanisms will require different configurations.
func (*HTTP) QueryLast ¶
QueryLast performs a query and attempts to fetch last n messages where n is specified by limit argument. It returns a channel which will be ranged over to retrieve messages asynchronously.
func (*HTTP) Store ¶
Store is used to store a message, the SSID provided must be a full SSID SSID, where first element should be a contract ID. The time resolution for TTL will be in seconds. The function is executed synchronously and it returns an error if some error was encountered during storage.
type InMemory ¶
type InMemory struct { Query func(string, []byte) (message.Awaiter, error) // The cluster request function. // contains filtered or unexported fields }
InMemory represents a storage which does nothing.
func NewInMemory ¶
NewInMemory creates a new in-memory storage.
func (*InMemory) Close ¶
Close gracefully terminates the storage and ensures that every related resource is properly disposed.
func (*InMemory) Configure ¶
Configure configures the storage. The config parameter provided is loosely typed, since various storage mechanisms will require different configurations.
func (*InMemory) QueryLast ¶
QueryLast performs a query and attempts to fetch last n messages where n is specified by limit argument. It returns a channel which will be ranged over to retrieve messages asynchronously.
func (*InMemory) Store ¶
Store is used to store a message, the SSID provided must be a full SSID SSID, where first element should be a contract ID. The time resolution for TTL will be in seconds. The function is executed synchronously and it returns an error if some error was encountered during storage.
type Noop ¶
type Noop struct{}
Noop represents a storage which does nothing.
func (*Noop) Close ¶
Close gracefully terminates the storage and ensures that every related resource is properly disposed.
func (*Noop) Configure ¶
Configure configures the storage. The config parameter provided is loosely typed, since various storage mechanisms will require different configurations.
func (*Noop) QueryLast ¶
QueryLast performs a query and attempts to fetch last n messages where n is specified by limit argument. It returns a channel which will be ranged over to retrieve messages asynchronously.
func (*Noop) Store ¶
Store is used to store a message, the SSID provided must be a full SSID SSID, where first element should be a contract ID. The time resolution for TTL will be in seconds. The function is executed synchronously and it returns an error if some error was encountered during storage.
type Storage ¶
type Storage interface { config.Provider io.Closer // Store is used to store a message, the SSID provided must be a full SSID // SSID, where first element should be a contract ID. The time resolution // for TTL will be in seconds. The function is executed synchronously and // it returns an error if some error was encountered during storage. Store(m *message.Message) error // QueryLast performs a query and attempts to fetch last n messages where // n is specified by limit argument. It returns a channel which will be // ranged over to retrieve messages asynchronously. QueryLast(ssid []uint32, limit int) (<-chan []byte, error) }
Storage represents a message storage contract that message storage provides must fulfill.