Documentation
Index ¶
- type InMemory
- func (s *InMemory) Close() error
- func (s *InMemory) Configure(config map[string]interface{}) error
- func (s *InMemory) Name() string
- func (s *InMemory) OnSurvey(surveyType string, payload []byte) ([]byte, bool)
- func (s *InMemory) Query(ssid message.Ssid, from, until time.Time, limit int) (message.Frame, error)
- func (s *InMemory) Store(m *message.Message) error
- type Noop
- type SSD
- func (s *SSD) Close() error
- func (s *SSD) Configure(config map[string]interface{}) error
- func (s *SSD) GC()
- func (s *SSD) Name() string
- func (s *SSD) OnSurvey(surveyType string, payload []byte) ([]byte, bool)
- func (s *SSD) Query(ssid message.Ssid, from, until time.Time, limit int) (message.Frame, error)
- func (s *SSD) Store(m *message.Message) error
- type Storage
Constants ¶
Variables ¶
Functions ¶
Types ¶
type InMemory ¶
type InMemory struct {
// 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) Query ¶
func (s *InMemory) Query(ssid message.Ssid, from, until time.Time, limit int) (message.Frame, error)
Query performs a query and attempts to fetch last n messages where n is specified by limit argument. From and until times can also be specified for time-series retrieval.
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) Query ¶
Query performs a query and attempts to fetch last n messages where n is specified by limit argument. From and until times can also be specified for time-series retrieval.
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 SSD ¶
type SSD struct {
// contains filtered or unexported fields
}
SSD represents an SSD-optimized storage storage.
func (*SSD) Configure ¶
Configure configures the storage. The config parameter provided is loosely typed, since various storage mechanisms will require different configurations.
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 // Query performs a query and attempts to fetch last n messages where // n is specified by limit argument. From and until times can also be specified // for time-series retrieval. Query(ssid message.Ssid, from, until time.Time, limit int) (message.Frame, error) }
Storage represents a message storage contract that message storage provides must fulfill.