Versions in this module Expand all Collapse all v1 v1.0.0 Aug 3, 2024 Changes in this version + const DocumentID + type Collection struct + func NewCollection[T interface{}](connection *Connection, path string) (*Collection[T], error) + func (c *Collection[T]) Count(ctx context.Context, query Query) (int64, error) + func (c *Collection[T]) Create(ctx context.Context, data *T, opts ...Options) (string, error) + func (c *Collection[T]) DeleteById(ctx context.Context, id string) error + func (c *Collection[T]) Find(ctx context.Context, query Query) ([]Document[T], error) + func (c *Collection[T]) FindById(ctx context.Context, id string) (T, error) + func (c *Collection[T]) UpdateById(ctx context.Context, id string, data *T, opts ...Options) error + func (c *Collection[T]) Validate(ctx context.Context, data *T, opts ...Options) error + type Connection struct + func Connect(client *firestore.Client) *Connection + func (c *Connection) RegisterTransformation(name string, transformation TransformationFn) error + func (c *Connection) RegisterValidation(name string, validation ValidationFn) error + type Direction int32 + const Asc + const Desc + type Document struct + Data T + ID string + type FieldError interface + Code func() string + Error func() string + Field func() string + Kind func() reflect.Kind + Param func() string + StructField func() string + Tag func() string + Type func() reflect.Type + Value func() interface{} + type Options struct + func NewOptions() Options + func (o Options) AllowEmptyFields(fields ...string) Options + func (o Options) CustomID(id string) Options + func (o Options) MergeFields(fields ...string) Options + func (o Options) SkipValidation() Options + type Query struct + func NewQuery() Query + func (q Query) EndAt(value ...interface{}) Query + func (q Query) EndBefore(value ...interface{}) Query + func (q Query) Limit(num int) Query + func (q Query) LimitToLast(num int) Query + func (q Query) Offset(num int) Query + func (q Query) OrderBy(path string, direction Direction) Query + func (q Query) StartAfter(value ...interface{}) Query + func (q Query) StartAt(value ...interface{}) Query + func (q Query) Where(path string, operator string, value interface{}) Query + type TransformationFn func(ctx context.Context, path string, value reflect.Value) (interface{}, error) + type ValidationFn func(ctx context.Context, path string, value reflect.Value, param string) (bool, error) Other modules containing this package github.com/bobch27/firevault-go/v2 github.com/bobch27/firevault-go/v3