veracity

package module
v0.0.0-...-48a8f37 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 16 Imported by: 0

README

Veracity

Veracity is an event-sourced Dogma engine with a focus on horizontal scalability and "shardability" of data.

Documentation Latest Version Build Status Code Coverage

  • interop api
    • discoverspec - serves list of running applications
    • eventstreamspec - serves events in real-time
      • update to support partitioning / multiple streams per app
      • mesh router - routes API requests to appropriate node
  • cluster
    • registry - queries which nodes are present
    • sharding - allocates "work" to specific nodes (rendezvous hashing)
      • aggregate instances
      • process instances
      • projection "consumers" (one per event stream per projection)
    • cluster api - gRPC API used to communicate between nodes in the same cluster
  • persistence
    • postgres - implement journal and kv store
    • dynamodb - kv store
  • command executor
  • aggregates
  • processes
  • integrations
  • projections

Documentation

Overview

Package veracity is an event-sourced Dogma engine with a focus on horizontal scalability and "shardability" of data.

Index

Constants

This section is empty.

Variables

View Source
var FerriteRegistry = engineconfig.FerriteRegistry

FerriteRegistry is a registry of the environment variables used by Veracity.

It can be used with the [ferrite] package.

Functions

This section is empty.

Types

type Engine

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

Engine hosts a Dogma application.

func New

func New(app dogma.Application, options ...EngineOption) *Engine

New returns an engine that hosts the given application.

func (*Engine) Close

func (e *Engine) Close() error

Close stops the engine immediately.

func (*Engine) ExecuteCommand

func (e *Engine) ExecuteCommand(
	ctx context.Context,
	c dogma.Command,
	options ...dogma.ExecuteCommandOption,
) error

ExecuteCommand enqueues a command for execution.

It may be called without calling Engine.Run. In this mode of operation, the engine acts solely as a router that forwards messages to worker nodes.

func (*Engine) Run

func (e *Engine) Run(ctx context.Context) error

Run joins the cluster as a worker that handles the application's messages.

It blocks until ctx is canceled or an error occurs.

type EngineOption

type EngineOption func(*engineconfig.Config)

An EngineOption configures the behavior of an Engine.

func WithGRPCAdvertiseAddresses

func WithGRPCAdvertiseAddresses(addresses ...string) EngineOption

WithGRPCAdvertiseAddresses is an EngineOption that sets the network addresses at which the engine's internal gRPC server can be reached by other nodes in the cluster.

func WithGRPCDialOptions

func WithGRPCDialOptions(options ...grpc.DialOption) EngineOption

WithGRPCDialOptions is an EngineOption that sets the gRPC options to use when connecting to other nodes in the cluster.

func WithGRPCListenAddress

func WithGRPCListenAddress(addr string) EngineOption

WithGRPCListenAddress is an EngineOption that sets the network address for the engine's internal gRPC server.

func WithGRPCServerOptions

func WithGRPCServerOptions(options ...grpc.ServerOption) EngineOption

WithGRPCServerOptions is an EngineOption that sets the gRPC options to use when starting the internal gRPC server.

func WithJournalStore

func WithJournalStore(s journal.BinaryStore) EngineOption

WithJournalStore is an EngineOption that sets the journal store used by the engine.

func WithKeyValueStore

func WithKeyValueStore(s kv.BinaryStore) EngineOption

WithKeyValueStore is an EngineOption that sets the key/value store used by the engine.

func WithLogger

func WithLogger(l *slog.Logger) EngineOption

WithLogger is an EngineOption that setes the logger used by the engine.

func WithMetricProvider

func WithMetricProvider(p metric.MeterProvider) EngineOption

WithMetricProvider is an EngineOption that sets the OpenTelemetry meter provider used by the engine.

func WithNodeID

func WithNodeID(id *uuidpb.UUID) EngineOption

WithNodeID is an EngineOption that sets the node ID of the engine.

func WithOptionsFromEnvironment

func WithOptionsFromEnvironment() EngineOption

WithOptionsFromEnvironment is an engine option that configures the engine using options specified via environment variables.

Any explicit options passed to New take precedence over options from the environment.

func WithTracerProvider

func WithTracerProvider(p trace.TracerProvider) EngineOption

WithTracerProvider is an EngineOption that sets the OpenTelemetry tracer provider used by the engine.

Directories

Path Synopsis
cmd
internal
cluster
Package cluster represents the nodes within a Veracity cluster.
Package cluster represents the nodes within a Veracity cluster.
engineconfig
Package engineconfig builds configuration for an engine.
Package engineconfig builds configuration for an engine.
envelope
Package envelope contains tools for working with message envelopes.
Package envelope contains tools for working with message envelopes.
eventstream
Package eventstream is the "event stream sub-system".
Package eventstream is the "event stream sub-system".
eventstream/internal/eventstreamjournal
Package eventstreamjournal encapsulates the integration subsystem's use of journal related persistence.
Package eventstreamjournal encapsulates the integration subsystem's use of journal related persistence.
fsm
Package fsm contains tools for implementing simple state machines.
Package fsm contains tools for implementing simple state machines.
integration
Package integration dispatches commands to integration message handlers.
Package integration dispatches commands to integration message handlers.
integration/internal/integrationjournal
Package integrationjournal encapsulates the integration subsystem's use of journal related persistence.
Package integrationjournal encapsulates the integration subsystem's use of journal related persistence.
integration/internal/integrationkv
Package integrationkv encapsulates the integration subsystem's use of key/value related persistence.
Package integrationkv encapsulates the integration subsystem's use of key/value related persistence.
messaging
Package messaging provides higher-order messaging primitives.
Package messaging provides higher-order messaging primitives.
optimistic
Package optimistic contains a set of "lock-free" data types that use optimistic concurrency control to allow atomic mutations.
Package optimistic contains a set of "lock-free" data types that use optimistic concurrency control to allow atomic mutations.
signaling
Package signaling provides higher-order signaling primitives.
Package signaling provides higher-order signaling primitives.
telemetry
Package telemetry is Veracity's internal API for observability/instrumentation.
Package telemetry is Veracity's internal API for observability/instrumentation.
test
Package test contains internal testing utilities.
Package test contains internal testing utilities.

Jump to

Keyboard shortcuts

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