Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entity ¶
type Entity interface {
GetID() string
}
Entity is an interface that some implementations will need to support to index items in a database.
type Options ¶
Options is a set of query parameters.
func MakeOpts ¶
func MakeOpts(opts []QueryOption) Options
MakeOpts returns a set of query parameters.
type QueryOption ¶
type QueryOption = func(*opt)
QueryOption provides a way to supply a cursor or a limit to a query.
func Descending ¶
func Descending() QueryOption
Desending returns the query results in desending order based on creation time.
func WithLimit ¶
func WithLimit(n int) QueryOption
WithLimit limits the number of items returned in a query.
type Repo ¶
type Repo[A any] interface { Find(ctx context.Context, id string) (A, error) Save(ctx context.Context, item A) error Query(ctx context.Context, opts ...QueryOption) ([]A, Cursor, error) Delete(ctx context.Context, id string) error }
Repo provides a way of storeing a generic Go item in a database.
Click to show internal directories.
Click to hide internal directories.