persistence

package
v0.0.0-...-c1e6758 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is the error returned if a resource cannot be found.
	ErrNotFound = errors.New("not found error")

	// ErrNotValid is the error returned if the data provided is invalid.
	ErrNotValid = errors.New("invalid data error")

	// ErrInternal is the error returned if an internal error occurred.
	ErrInternal = errors.New("internal error")
)

Functions

func WithTelemetry

func WithTelemetry(wrapped Service, tracer trace.Tracer) *wrapper

WithTelemetry enriches Service by adding instrumentation and context.

Types

type PackageUpdater

type PackageUpdater func(*datatypes.Package) (*datatypes.Package, error)

type Service

type Service interface {
	// CreatePackage persists the given Package to the data store then updates
	// the Package from the data store, adding auto-generated data
	// (e.g. ID, CreatedAt).
	CreatePackage(context.Context, *datatypes.Package) error
	UpdatePackage(context.Context, uint, PackageUpdater) (*datatypes.Package, error)

	CreatePreservationTask(context.Context, *datatypes.PreservationTask) error
	UpdatePreservationTask(ctx context.Context, id uint, updater PresTaskUpdater) (*datatypes.PreservationTask, error)
}

Directories

Path Synopsis
ent
db
Package fake is a generated GoMock package.
Package fake is a generated GoMock package.

Jump to

Keyboard shortcuts

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