es

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 11 Imported by: 0

README

Event Store

Coverage Status ci status

A serverless-first kit that simplifies the use of event-sourcing and event-logging patterns.

It offers two main components:

  • A Go module that represents the Go library;
  • A Serverless Application that deals with events storage, indexing, and forwarding;
Features:
  • Multi-tenancy friendly stream design that supports global streams with time-stamp and version-based sub-streams.
  • Push and pull-based subscription support for global streams.
  • Crypto shredding support for Personal data (PII) at the event level.
  • Strong consistent ordering for version-based streams (best-effort ordering for global streams)
Event Store Implementations:
Elastic

Built on top of Dynamodb, Lambda functions, and SNS topics.

In-Memory

Simplified implementation for testing purposes.

Event Encoding Formats:
JSON

The default encoding format; lacks support for event schema evolution.

AVRO

With a built-in AWS Glue schema registry integration, event schemas can evolve while ensuring backward compatibility in a fail-fast approach.

Documentation

Index

Constants

View Source
const ELASTIC_VERSION = "v0.0.1"

ELASTIC_VERSION is the current version of the elastic stack.

Variables

This section is empty.

Functions

func DiscardLogger added in v0.0.2

func DiscardLogger() logr.Logger

DiscardLogger returns a mute logger. Pass the mute logger to 'SetDefaultLogger' to disable library internal logging.

func SetDefaultLogger added in v0.0.2

func SetDefaultLogger(log logr.Logger)

SetDefaultLogger allows to override the internal default logger used by the library.

Types

type ElasticStoreConfig added in v0.0.2

type ElasticStoreConfig struct {
	// LoadAWSConfig is used as fallback solution to get the needed AWS config
	// to initiate AWS service clients.
	LoadAWSConfig func() (aws.Config, error)

	// DynamodbClient presents the AWS SDK V2 client for Dynamodb service.
	// If not found the library tries to initiate it from the resolved AWS Config.
	DynamodbClient dynamodb.ClientAPI

	// EnableTracing is enabled by default. By default it enable X-Ray tracing
	// at dynamodb event store level.
	EnableTracing bool
	// contains filtered or unexported fields
}

ElasticStoreConfig presents the config used by The Elastic Event Store client. It mainly serves as facade for the specific infra implementation of the event store.

func (*ElasticStoreConfig) AddDynamodbStoreOption added in v0.0.2

func (esc *ElasticStoreConfig) AddDynamodbStoreOption(opt func(*dynamodb.StoreConfig))

type EventStore

type EventStore interface {
	event.Store
	event_sourcing.Store
	event.Streamer
}

EventStore interface combines the following low-level Event Store related interfaces:

- event.Store: defines an event store that support event logging pattern;

- sourcing.Store: defines an event store that support event sourcing pattern;

- event.Streamer: defines an event store that support streaming event from the global stream;

func NewElasticStore added in v0.0.2

func NewElasticStore(dynamodbTable string, opts ...func(*ElasticStoreConfig)) EventStore

NewElasticStore returns a client for the Elastic Event Store, which is built on Dynamodb, supporting event-sourcing, and event-logging patterns.

If underlying infra SDK clients are not found in the config, it will attempt to initiate them using the default environment configuration.

Note that tracing is enabled by default, and AWS X-Ray service is used under the hood.

type Version

type Version string
const MODULE_VERSION Version = "v0.0.1"

MODULE_VERSION is the current version of the Go Module.

func (Version) Semver

func (v Version) Semver() *semver.Version

Semver parses and returns semver struct.

Directories

Path Synopsis
fs
examples
internal
stack
elastic Module
tool module

Jump to

Keyboard shortcuts

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