Documentation ¶
Index ¶
- Variables
- type EventErrorIterator
- type EventIterator
- type Key
- type Segment
- type Store
- func (s *Store) Close() error
- func (s *Store) Count(slice *util.Range) (count uint64, err error)
- func (s *Store) Insert(event *api.EventWrapper) (err error)
- func (s *Store) List(topicID ulid.ULID) iterator.EventIterator
- func (s *Store) ReadOnly() bool
- func (s *Store) Retrieve(topicId ulid.ULID, eventID rlid.RLID) (event *api.EventWrapper, err error)
Constants ¶
This section is empty.
Variables ¶
var ( EventSegment = Segment{0xdf, 0xb7} MetaEventSegment = Segment{0xd6, 0x8d} )
Segments in use by the Ensign event store
Functions ¶
This section is empty.
Types ¶
type EventErrorIterator ¶ added in v0.9.0
type EventErrorIterator struct {
errors.ErrorIterator
}
Implements iterator.EventIterator to return an error.
func (*EventErrorIterator) Event ¶ added in v0.9.0
func (i *EventErrorIterator) Event() (*api.EventWrapper, error)
type EventIterator ¶ added in v0.9.0
Implements iterator.EventIterator to access to a sequence of events in a topic.
func (*EventIterator) Error ¶ added in v0.9.0
func (i *EventIterator) Error() error
func (*EventIterator) Event ¶ added in v0.9.0
func (i *EventIterator) Event() (*api.EventWrapper, error)
type Key ¶ added in v0.9.0
type Key [28]byte
Key is is the 16 byte topic ID followed by a 2 byte segment that splits events from meta events then the 10 byte RLID for an event ID.
func MetaEventKey ¶ added in v0.9.0
func MetaEventKey(event *api.EventWrapper) (key Key, err error)
type Segment ¶ added in v0.9.0
type Segment [2]byte
Segments ensure that a topic's events and meta events are stored contiguously.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Count ¶ added in v0.9.0
Count the number of objects that match the specified range by iterating through all of the keys and counting them. This is primarily used for testing.
func (*Store) Insert ¶ added in v0.9.0
func (s *Store) Insert(event *api.EventWrapper) (err error)
Insert an event with the event segment into the database. If the event doesn't have an ID or a TopicID, an error is returned. This method also ensures that the localID is not stored and is nil. No other validation is performed by the database as this method is designed to write as quickly as possible.
func (*Store) List ¶ added in v0.9.0
func (s *Store) List(topicID ulid.ULID) iterator.EventIterator
Returns an iterator of events in the specified topic. If an offset RLID is specified