Documentation ¶
Index ¶
- Variables
- type And
- type Collection
- type Config
- type Create
- type Creator
- type Database
- type Delete
- type Deleter
- type Equals
- type Event
- type Exists
- type Field
- type FieldType
- type Filter
- type GreaterThan
- type GreaterThanOrEquals
- type In
- type InArray
- type Index
- type LessThan
- type LessThanOrEquals
- type Like
- type NotEquals
- type NotIn
- type NotInArray
- type NotLike
- type Operation
- type Or
- type Order
- type Querier
- type Query
- func (q *Query[T]) All(ctx context.Context) ([]T, error)
- func (q *Query[T]) Channel(ctx context.Context) (<-chan T, error)
- func (q *Query[T]) Count(ctx context.Context) (int64, error)
- func (q *Query[T]) In(rng *Range) *Query[T]
- func (q *Query[T]) Single(ctx context.Context) (T, error)
- func (q *Query[T]) Sort(key string, order ...*Order) *Query[T]
- func (q *Query[T]) Where(filter Filter) *Query[T]
- type Range
- type Regex
- type Transaction
- type TransactionFn
- type Transactor
- type Update
- type Updater
- type Watch
- type WatchHandler
- type Watcher
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorInvalidFilter = errors.New("invalid filter")
)
View Source
var ( OperationAny = []Operation{ OperationCreate, OperationUpdate, OperationDelete, } )
Functions ¶
This section is empty.
Types ¶
type Collection ¶
func NewCollection ¶
func NewCollection(database *Database, name string) *Collection
type GreaterThan ¶
type GreaterThan struct {
// contains filtered or unexported fields
}
func NewGreaterThan ¶
func NewGreaterThan(key string, value any) *GreaterThan
func (*GreaterThan) Key ¶
func (l *GreaterThan) Key() string
func (*GreaterThan) Left ¶
func (l *GreaterThan) Left() Filter
func (*GreaterThan) Right ¶
func (l *GreaterThan) Right() Filter
func (*GreaterThan) Value ¶
func (l *GreaterThan) Value() any
func (*GreaterThan) Values ¶
func (l *GreaterThan) Values() []any
type GreaterThanOrEquals ¶
type GreaterThanOrEquals struct {
// contains filtered or unexported fields
}
func NewGreaterThanOrEquals ¶
func NewGreaterThanOrEquals(key string, value any) *GreaterThanOrEquals
func (*GreaterThanOrEquals) Key ¶
func (l *GreaterThanOrEquals) Key() string
func (*GreaterThanOrEquals) Left ¶
func (l *GreaterThanOrEquals) Left() Filter
func (*GreaterThanOrEquals) Right ¶
func (l *GreaterThanOrEquals) Right() Filter
func (*GreaterThanOrEquals) Value ¶
func (l *GreaterThanOrEquals) Value() any
func (*GreaterThanOrEquals) Values ¶
func (l *GreaterThanOrEquals) Values() []any
type LessThan ¶
type LessThan struct {
// contains filtered or unexported fields
}
func NewLessThan ¶
type LessThanOrEquals ¶
type LessThanOrEquals struct {
// contains filtered or unexported fields
}
func NewLessThanOrEquals ¶
func NewLessThanOrEquals(key string, value any) *LessThanOrEquals
func (*LessThanOrEquals) Key ¶
func (l *LessThanOrEquals) Key() string
func (*LessThanOrEquals) Left ¶
func (l *LessThanOrEquals) Left() Filter
func (*LessThanOrEquals) Right ¶
func (l *LessThanOrEquals) Right() Filter
func (*LessThanOrEquals) Value ¶
func (l *LessThanOrEquals) Value() any
func (*LessThanOrEquals) Values ¶
func (l *LessThanOrEquals) Values() []any
type Like ¶ added in v4.2.0
type Like struct {
// contains filtered or unexported fields
}
func (*Like) IsCaseInsensitive ¶ added in v4.2.0
type NotEquals ¶
type NotEquals struct {
// contains filtered or unexported fields
}
func NewNotEquals ¶
type NotInArray ¶
type NotInArray struct {
// contains filtered or unexported fields
}
func NewNotInArray ¶
func NewNotInArray(key string, values ...any) *NotInArray
func (*NotInArray) Key ¶
func (l *NotInArray) Key() string
func (*NotInArray) Left ¶
func (l *NotInArray) Left() Filter
func (*NotInArray) Right ¶
func (l *NotInArray) Right() Filter
func (*NotInArray) Value ¶
func (l *NotInArray) Value() any
func (*NotInArray) Values ¶
func (l *NotInArray) Values() []any
type NotLike ¶ added in v4.2.0
type NotLike struct {
// contains filtered or unexported fields
}
func NewNotLike ¶ added in v4.2.0
func (*NotLike) IsCaseInsensitive ¶ added in v4.2.0
type Order ¶
type Order struct {
IsAscending bool
}
func NewAscendingOrder ¶
func NewAscendingOrder() *Order
func NewDescendingOrder ¶
func NewDescendingOrder() *Order
type Query ¶
type Query[T any] struct { Filters []Filter Sorting map[string]*Order Range *Range // contains filtered or unexported fields }
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction(transactor Transactor) *Transaction
func (*Transaction) Run ¶
func (t *Transaction) Run(ctx context.Context, fn TransactionFn) error
type TransactionFn ¶
type Transactor ¶
type Transactor interface {
ExecuteTransaction(ctx context.Context, fn TransactionFn) error
}
type Update ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.