model

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0, MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoData = noData{}

NoData is a model with no data to persist.

Functions

This section is empty.

Types

type Persistable

type Persistable interface {
	Persist(ctx context.Context, s StorageBatch) error
}

A Persistable can persist a full copy of itself or its components as part of a storage batch

type PersistableList added in v0.5.0

type PersistableList []Persistable

A PersistableList is a list of Persistables that should be persisted together

func (PersistableList) Persist added in v0.5.0

func (pl PersistableList) Persist(ctx context.Context, s StorageBatch) error

type Storage added in v0.5.0

type Storage interface {
	PersistBatch(ctx context.Context, ps ...Persistable) error
}

A Storage can marshal models into a serializable format and persist them.

type StorageBatch added in v0.5.0

type StorageBatch interface {
	PersistModel(ctx context.Context, m interface{}) error
}

A StorageBatch persists a model to storage as part of a batch such as a transaction.

Directories

Path Synopsis
actors

Jump to

Keyboard shortcuts

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