api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity interface {
	JSONField() string
	TableName() string
	Schema() string
	GetMeta() *v1.Meta
	Kind() string
	APIVersion() string
}

Entity defines a database entity which is stored in jsonb format and with version information

type Storage

type Storage[E Entity] interface {
	// generic
	Create(ctx context.Context, ve E) error
	Update(ctx context.Context, ve E) error
	Delete(ctx context.Context, id string) error
	DeleteAll(ctx context.Context, ids ...string) error
	Get(ctx context.Context, id string) (E, error)
	GetHistory(ctx context.Context, id string, at time.Time, ve E) error
	GetHistoryCreated(ctx context.Context, id string, ve E) error
	Find(ctx context.Context, paging *v1.Paging, filters ...any) ([]E, *uint64, error)
}

Storage is a interface to store objects.

Jump to

Keyboard shortcuts

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