dao

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when the requested entity does not exist in the
	// underlying storage.
	ErrNotFound = errors.New("dao: not found")

	// ErrInvalidID indicates that the supplied ID/key is empty or otherwise
	// invalid.
	ErrInvalidID = errors.New("dao: invalid id")

	// ErrNilEntity is returned when the caller attempts to persist a nil
	// pointer.
	ErrNilEntity = errors.New("dao: nil entity")
)

Functions

This section is empty.

Types

type Parameter

type Parameter struct {
	Name  string
	Value interface{}
}

func NewParameter

func NewParameter(name string, values ...string) *Parameter

type Service

type Service[K comparable, T any] interface {
	Save(ctx context.Context, t *T) error

	Load(ctx context.Context, id K) (*T, error)

	Delete(ctx context.Context, id K) error

	List(ctx context.Context, parameters ...*Parameter) ([]*T, error)
}

Directories

Path Synopsis
execution
fs
process
fs

Jump to

Keyboard shortcuts

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