Versions in this module Expand all Collapse all v1 v1.1.0 Jun 29, 2020 v1.0.0 Jun 24, 2020 Changes in this version + var ErrDocumentNotExist = errors.New("document: doesn't exist") + var ErrFieldRetrieve = errors.New("field: couldn't retrieve the field value") + type Array struct + Document Document + Name string + func (a *Array) Append(ctx context.Context, data []interface{}) error + func (a *Array) Override(ctx context.Context, data []interface{}) error + func (a *Array) Retrieve(ctx context.Context) ([]interface{}, error) + type ArrayField interface + Append func(ctx context.Context, data []interface{}) error + Override func(ctx context.Context, data []interface{}) error + Retrieve func(ctx context.Context) ([]interface{}, error) + type Boolean struct + Document Document + Name string + func (b *Boolean) Retrieve(ctx context.Context) (bool, error) + func (b *Boolean) Update(ctx context.Context, with bool) error + type BooleanField interface + Retrieve func(ctx context.Context) (bool, error) + Update func(ctx context.Context, with bool) error + type Document interface + Array func(name string) *Array + Batch func() *firestore.WriteBatch + Boolean func(name string) *Boolean + Create func(ctx context.Context, from interface{}) error + Delete func(ctx context.Context) error + Exists func(ctx context.Context) bool + GetDocumentRef func() *firestore.DocumentRef + InBatch func() bool + Map func(name string) *Map + Number func(name string) *Number + Retrieve func(ctx context.Context, to interface{}) error + String func(name string) *String + Timestamp func(name string) *Timestamp + type FirestoreDocument struct + ColRef *firestore.CollectionRef + ID string + func New(fs *firestore.Client, path, documentID string, wb *firestore.WriteBatch) *FirestoreDocument + func (d *FirestoreDocument) Array(name string) *Array + func (d *FirestoreDocument) Batch() *firestore.WriteBatch + func (d *FirestoreDocument) Boolean(name string) *Boolean + func (d *FirestoreDocument) Create(ctx context.Context, from interface{}) error + func (d *FirestoreDocument) Delete(ctx context.Context) error + func (d *FirestoreDocument) Exists(ctx context.Context) bool + func (d *FirestoreDocument) GetDocumentRef() *firestore.DocumentRef + func (d *FirestoreDocument) InBatch() bool + func (d *FirestoreDocument) Map(name string) *Map + func (d *FirestoreDocument) Number(name string) *Number + func (d *FirestoreDocument) Retrieve(ctx context.Context, to interface{}) error + func (d *FirestoreDocument) String(name string) *String + func (d *FirestoreDocument) Timestamp(name string) *Timestamp + type Map struct + Document Document + Name string + func (m *Map) Merge(ctx context.Context, data map[string]interface{}) error + func (m *Map) Override(ctx context.Context, data map[string]interface{}) error + func (m *Map) Retrieve(ctx context.Context) (map[string]interface{}, error) + type MapField interface + Merge func(ctx context.Context, data map[string]interface{}) error + Override func(ctx context.Context, data map[string]interface{}) error + Retrieve func(ctx context.Context) (map[string]interface{}, error) + type Number struct + Document Document + Name string + func (n *Number) Decrement(ctx context.Context) error + func (n *Number) Increment(ctx context.Context) error + func (n *Number) Retrieve(ctx context.Context) (int64, error) + func (n *Number) Update(ctx context.Context, with int64) error + type NumberField interface + Decrement func(ctx context.Context) error + Increment func(ctx context.Context) error + Retrieve func(ctx context.Context) (int64, error) + Update func(ctx context.Context, with int64) error + type String struct + Document Document + Name string + func (s *String) Retrieve(ctx context.Context) (string, error) + func (s *String) Update(ctx context.Context, with string) error + type StringField interface + Retrieve func(ctx context.Context) (string, error) + Update func(ctx context.Context, with string) error + type Timestamp struct + Document Document + Name string + func (t *Timestamp) Retrieve(ctx context.Context, location string) (time.Time, error) + func (t *Timestamp) Update(ctx context.Context, with time.Time) error + type TimestampField interface + Retrieve func(ctx context.Context, location string) (time.Time, error) + Update func(ctx context.Context, with time.Time) error