namespace

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrValidateQuery = errors.New("validate query")
	ErrExecuteQuery  = errors.New("execute query")
)

Functions

This section is empty.

Types

type Iterator

type Iterator interface {
	Next(ctx context.Context) bool
	Item() record.Record
	Size() int
	Err() error
}

type Namespace

type Namespace interface {
	Get(id int64) record.Record
	Insert(item record.Record) error
	Delete(id int64) error
	Upsert(item record.Record) error
	SelectForExecutor(conditions where.Conditions) ([]record.Record, error)
}

type QueryExecutor

type QueryExecutor interface {
	FetchTotal(ctx context.Context, q query.Query) (int, error)
	FetchAll(ctx context.Context, q query.Query) (Iterator, error)
	FetchAllAndTotal(ctx context.Context, q query.Query) (Iterator, int, error)
}

func CreateQueryExecutor

func CreateQueryExecutor(storage Namespace) QueryExecutor

Jump to

Keyboard shortcuts

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