events

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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)

func (*EventErrorIterator) Seek added in v0.9.0

func (i *EventErrorIterator) Seek(eventID rlid.RLID) bool

type EventIterator added in v0.9.0

type EventIterator struct {
	ldbiter.Iterator
	// contains filtered or unexported fields
}

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)

func (*EventIterator) Seek added in v0.9.0

func (t *EventIterator) Seek(eventID rlid.RLID) bool

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 CreateKey added in v0.9.0

func CreateKey(topicID ulid.ULID, eventID rlid.RLID, segment Segment) (key Key, err error)

func EventKey added in v0.9.0

func EventKey(event *api.EventWrapper) (key Key, err error)

func MetaEventKey added in v0.9.0

func MetaEventKey(event *api.EventWrapper) (key Key, err error)

func (*Key) EventID added in v0.9.0

func (k *Key) EventID() (eventID rlid.RLID)

EventID parses and returns the eventID RLID from the key.

func (*Key) Segment added in v0.9.0

func (k *Key) Segment() Segment

func (*Key) TopicID added in v0.9.0

func (k *Key) TopicID() (topicID ulid.ULID)

TopicID parses and returns the topicID ULID from the key.

type Segment added in v0.9.0

type Segment [2]byte

Segments ensure that a topic's events and meta events are stored contiguously.

func (Segment) String added in v0.9.0

func (s Segment) String() string

type Store

type Store struct {
	// contains filtered or unexported fields
}

func Open

func Open(conf config.StorageConfig) (store *Store, err error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Count added in v0.9.0

func (s *Store) Count(slice *util.Range) (count uint64, err error)

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

func (*Store) ReadOnly

func (s *Store) ReadOnly() bool

func (*Store) Retrieve added in v0.9.0

func (s *Store) Retrieve(topicId ulid.ULID, eventID rlid.RLID) (event *api.EventWrapper, err error)

Retrieve a specific event from the database by topic and eventID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL