Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BinaryCondition ¶
type BinaryCondition[T any, V comparable] struct { Field string Operator Operator Value V Accessor func(T) V }
binaryCondition defines binary operator as Specification It is used for =, >, <, >=, <= operators.
func (BinaryCondition[T, V]) Match ¶
func (s BinaryCondition[T, V]) Match(t T) bool
func (BinaryCondition[T, V]) String ¶
func (s BinaryCondition[T, V]) String() string
type Condition ¶
type FuncCondition ¶
func (FuncCondition[T]) Match ¶
func (fn FuncCondition[T]) Match(t T) bool
func (FuncCondition[T]) String ¶
func (fn FuncCondition[T]) String() string
type JoinCondition ¶
func (JoinCondition[T]) Match ¶
func (join JoinCondition[T]) Match(t T) bool
func (JoinCondition[T]) String ¶
func (join JoinCondition[T]) String() string
type NotCondition ¶
func (NotCondition[T]) Match ¶
func (not NotCondition[T]) Match(t T) bool
func (NotCondition[T]) String ¶
func (not NotCondition[T]) String() string
type Operator ¶
type Operator uint8
const ( // join operators AND Operator OR // binary operators EQUAL GREATER LESS GREATEROREQUAL LESSOREQUAL )
type Repository ¶
type Repository[T any] interface { // Create constructs + stores obj T. // If any identifiers are created as part of the insert, they are mutated on the incomming argument. Create(ctx context.Context, obj ...T) error // Get returns a single item matching a set of conditions Get(ctx context.Context, cond Condition[T]) (T, error) // List List(ctx context.Context, cond Condition[T]) Iterator[T] // Update Update(ctx context.Context, obj ...T) error // Delete Delete(ctx context.Context, obj ...T) error }
Click to show internal directories.
Click to hide internal directories.