version

package
v0.3.0-prerelease.5 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package version contains types and utilites to deal with Optimistic Concurrency.

Index

Constants

This section is empty.

Variables

View Source
var Any = CheckAny{}

Any avoids optimistic concurrency checks when requiring a version.Check instance.

View Source
var SelectFromBeginning = Selector{From: 0}

SelectFromBeginning is a Selector value that will return all Domain Events in an Event Stream.

Functions

This section is empty.

Types

type Check

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

Check can be used to perform optimistic concurrency checks when writing to the Event Store using the event.Appender interface.

type CheckAny

type CheckAny struct{}

CheckAny is a Check variant that will avoid optimistic concurrency checks when used.

type CheckExact

type CheckExact Version

CheckExact is a Check variant that will ensure the specified version is the current one (typically used when needing to check the version of an Event Stream).

type ConflictError

type ConflictError struct {
	Expected Version
	Actual   Version
}

ConflictError is an error returned by an Event Store when appending some events using an expected Event Stream version that does not match the current state of the Event Stream.

func (ConflictError) Error

func (err ConflictError) Error() string

type Selector

type Selector struct {
	From Version
}

Selector specifies which slice of the Event Stream to select when streaming Domain Events from the Event Store.

type Version

type Version uint32

Version is the type to specify Event Stream versions. Versions should be starting from 1, as they represent the length of a single Event Stream.

Jump to

Keyboard shortcuts

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