version

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo struct {
	eh.ReadWriteRepo
}

Repo is a middleware that adds version checking to a read repository.

func NewRepo

func NewRepo(repo eh.ReadWriteRepo) *Repo

NewRepo creates a new Repo.

func Repository

func Repository(repo eh.ReadRepo) *Repo

Repository returns a parent ReadRepo if there is one.

func (*Repo) Find

func (r *Repo) Find(ctx context.Context, id eh.UUID) (eh.Entity, error)

Find implements the Find method of the eventhorizon.ReadModel interface. If the context contains a min version set by WithMinVersion it will only return an item if its version is at least min version. If a timeout or deadline is set on the context it will repetedly try to get the item until either the version matches or the deadline is reached.

func (*Repo) Parent

func (r *Repo) Parent() eh.ReadRepo

Parent implements the Parent method of the eventhorizon.ReadRepo interface.

Jump to

Keyboard shortcuts

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