Documentation ¶
Index ¶
- type InMemory
- type Noop
- func (s *Noop) Close() error
- func (s *Noop) Configure(config map[string]interface{}) error
- func (s *Noop) Name() string
- func (s *Noop) OnSurvey(surveyType string, payload []byte) ([]byte, bool)
- func (s *Noop) Query(ssid message.Ssid, from, until time.Time, startFromID message.ID, limit int) (message.Frame, error)
- func (s *Noop) Store(m *message.Message) error
- 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, startFromID message.ID, limit int) (message.Frame, error)
- func (s *SSD) Store(m *message.Message) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemory ¶
type InMemory struct {
SSD // Badger with in-memory mode
}
InMemory represents a storage which does nothing.
func NewInMemory ¶
NewInMemory creates a new in-memory 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 ¶
func (s *Noop) Query(ssid message.Ssid, from, until time.Time, startFromID message.ID, 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 (*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.
func (*SSD) Query ¶
func (s *SSD) Query(ssid message.Ssid, from, until time.Time, startFromID message.ID, 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.
type Storage ¶
type Storage interface { config.Provider io.Closer survey.Surveyee // 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, startFromID message.ID, limit int) (message.Frame, error) }
Storage represents a message storage contract that message storage provides must fulfill.