cqldb

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Embedded cqldb.Config `yaml:",inline" json:",inline"`
	Table    string       `yaml:"table" json:"table"`
	// contains filtered or unexported fields
}

Config provides Mongo DB configuration options

func (*Config) Validate

func (c *Config) Validate() error

type EventStore

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

EventStore implements an EventStore for cqldb.

func New

func New(ctx context.Context, config *Config, fileWatcher *fsnotify.Watcher, logger log.Logger, tracerProvider trace.TracerProvider, opts ...Option) (*EventStore, error)

func (*EventStore) AddCloseFunc

func (s *EventStore) AddCloseFunc(f func())

func (*EventStore) Clear

func (s *EventStore) Clear(ctx context.Context) error

Clear clears the event storage.

func (*EventStore) ClearTable

func (s *EventStore) ClearTable(ctx context.Context) error

Clear documents in collections, but don't drop the database or the collections

func (*EventStore) Close

func (s *EventStore) Close(_ context.Context) error

Close closes the database session.

func (*EventStore) Delete

func (s *EventStore) Delete(ctx context.Context, queries []eventstore.DeleteQuery) error

Delete documents with given group ids

func (*EventStore) GetEvents

func (s *EventStore) GetEvents(ctx context.Context, queries []eventstore.GetEventsQuery, timestamp int64, eventHandler eventstore.Handler) error

Get events from the eventstore.

func (*EventStore) GetLatestDeviceETags

func (s *EventStore) GetLatestDeviceETags(ctx context.Context, deviceID string, limit uint32) ([][]byte, error)

Get latest ETags for device resources from event store for batch observing

func (*EventStore) LoadDeviceMetadataByServiceIDs

func (s *EventStore) LoadDeviceMetadataByServiceIDs(ctx context.Context, serviceIDs []string, limit int64) ([]eventstore.DeviceDocumentMetadata, error)

func (*EventStore) LoadFromSnapshot

func (s *EventStore) LoadFromSnapshot(ctx context.Context, queries []eventstore.SnapshotQuery, eventHandler eventstore.Handler) error

LoadFromSnapshot loads events from the last snapshot eventstore.

func (*EventStore) LoadFromVersion

func (s *EventStore) LoadFromVersion(ctx context.Context, queries []eventstore.VersionQuery, eh eventstore.Handler) error

LoadFromVersion loads aggregates events from version.

func (*EventStore) LoadUpToVersion

func (s *EventStore) LoadUpToVersion(_ context.Context, _ []eventstore.VersionQuery, _ eventstore.Handler) error

LoadUpToVersion loads aggregates events up to a specific version. It loads events from the last snapshot. Only last snapshots

func (*EventStore) Query

Query retrieves the latest snapshot version per aggregate for thw number of aggregates specified by 'limit'

func (*EventStore) Remove

func (s *EventStore) Remove(_ context.Context, _ maintenance.Task) error

Remove deletes (the latest snapshot version) database record for a given aggregate ID

func (*EventStore) RemoveUpToVersion

func (s *EventStore) RemoveUpToVersion(_ context.Context, _ []eventstore.VersionQuery) error

RemoveUpToVersion deletes the aggregated events up to a specific version.

func (*EventStore) Save

func (s *EventStore) Save(ctx context.Context, events ...eventstore.Event) (eventstore.SaveStatus, error)

Save save events to eventstore. AggregateID, GroupID and EventType are required. All events within one Save operation shall have the same AggregateID and GroupID. Versions shall be unique and ascend continually. Only first event can be a snapshot.

func (*EventStore) Table

func (s *EventStore) Table() string

type MarshalerFunc

type MarshalerFunc = func(v interface{}) ([]byte, error)

MarshalerFunc marshal struct to bytes.

type MarshalerOpt

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

func WithMarshaler

func WithMarshaler(f MarshalerFunc) MarshalerOpt

WithMarshaler provides the possibility to set an marshaling function for the config

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option provides the means to use function call chaining

type UnmarshalerFunc

type UnmarshalerFunc = func(b []byte, v interface{}) error

UnmarshalerFunc unmarshal bytes to pointer of struct.

type UnmarshalerOpt

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

func WithUnmarshaler

func WithUnmarshaler(f UnmarshalerFunc) UnmarshalerOpt

WithUnmarshaler provides the possibility to set an unmarshaling function for the config

Jump to

Keyboard shortcuts

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