Versions in this module Expand all Collapse all v0 v0.15.0 Oct 3, 2017 Changes in this version + const DefaultTransactionMaxAttempts + const DocumentID + var Delete = new(int) + var ErrConcurrentTransaction = errors.New("firestore: concurrent transaction") + var ReadOnly = ro + var ServerTimestamp = new(int) + func MaxAttempts(n int) maxAttempts + type Client struct + func NewClient(ctx context.Context, projectID string, opts ...option.ClientOption) (*Client, error) + func (c *Client) Batch() *WriteBatch + func (c *Client) Close() error + func (c *Client) Collection(path string) *CollectionRef + func (c *Client) Collections(ctx context.Context) *CollectionIterator + func (c *Client) Doc(path string) *DocumentRef + func (c *Client) GetAll(ctx context.Context, docRefs []*DocumentRef) ([]*DocumentSnapshot, error) + func (c *Client) RunTransaction(ctx context.Context, f func(context.Context, *Transaction) error, ...) error + type CollectionIterator struct + func (it *CollectionIterator) GetAll() ([]*CollectionRef, error) + func (it *CollectionIterator) Next() (*CollectionRef, error) + func (it *CollectionIterator) PageInfo() *iterator.PageInfo + type CollectionRef struct + ID string + Parent *DocumentRef + Path string + func (c *CollectionRef) Add(ctx context.Context, data interface{}) (*DocumentRef, *WriteResult, error) + func (c *CollectionRef) Doc(id string) *DocumentRef + func (c *CollectionRef) NewDoc() *DocumentRef + type Direction int32 + const Asc + const Desc + type DocumentIterator struct + func (it *DocumentIterator) GetAll() ([]*DocumentSnapshot, error) + func (it *DocumentIterator) Next() (*DocumentSnapshot, error) + type DocumentRef struct + ID string + Parent *CollectionRef + Path string + func (d *DocumentRef) Collection(id string) *CollectionRef + func (d *DocumentRef) Collections(ctx context.Context) *CollectionIterator + func (d *DocumentRef) Create(ctx context.Context, data interface{}) (*WriteResult, error) + func (d *DocumentRef) Delete(ctx context.Context, preconds ...Precondition) (*WriteResult, error) + func (d *DocumentRef) Get(ctx context.Context) (*DocumentSnapshot, error) + func (d *DocumentRef) Set(ctx context.Context, data interface{}, opts ...SetOption) (*WriteResult, error) + func (d *DocumentRef) UpdateMap(ctx context.Context, data map[string]interface{}, preconds ...Precondition) (*WriteResult, error) + func (d *DocumentRef) UpdatePaths(ctx context.Context, data []FieldPathUpdate, preconds ...Precondition) (*WriteResult, error) + func (d *DocumentRef) UpdateStruct(ctx context.Context, fieldPaths []string, data interface{}, ...) (*WriteResult, error) + type DocumentSnapshot struct + CreateTime time.Time + Ref *DocumentRef + UpdateTime time.Time + func (d *DocumentSnapshot) Data() map[string]interface{} + func (d *DocumentSnapshot) DataAt(fieldPath string) (interface{}, error) + func (d *DocumentSnapshot) DataAtPath(fp FieldPath) (interface{}, error) + func (d *DocumentSnapshot) DataTo(p interface{}) error + type FieldPath []string + type FieldPathUpdate struct + Path FieldPath + Value interface{} + type Precondition interface + func Exists(b bool) Precondition + func LastUpdateTime(t time.Time) Precondition + type Query struct + func (q Query) Documents(ctx context.Context) *DocumentIterator + func (q Query) EndAt(fieldValues ...interface{}) Query + func (q Query) EndBefore(fieldValues ...interface{}) Query + func (q Query) Limit(n int) Query + func (q Query) Offset(n int) Query + func (q Query) OrderBy(fieldPath string, dir Direction) Query + func (q Query) OrderByPath(fp FieldPath, dir Direction) Query + func (q Query) Select(fieldPaths ...string) Query + func (q Query) SelectPaths(fieldPaths ...FieldPath) Query + func (q Query) StartAfter(fieldValues ...interface{}) Query + func (q Query) StartAt(fieldValues ...interface{}) Query + func (q Query) Where(fieldPath, op string, value interface{}) Query + func (q Query) WherePath(fp FieldPath, op string, value interface{}) Query + type Queryer interface + type SetOption interface + var MergeAll SetOption = merge{} + func Merge(fieldPaths ...string) SetOption + func MergePaths(fps ...FieldPath) SetOption + type Transaction struct + func (t *Transaction) Create(dr *DocumentRef, data interface{}) error + func (t *Transaction) Delete(dr *DocumentRef, opts ...Precondition) error + func (t *Transaction) Documents(q Queryer) *DocumentIterator + func (t *Transaction) Get(dr *DocumentRef) (*DocumentSnapshot, error) + func (t *Transaction) Set(dr *DocumentRef, data interface{}, opts ...SetOption) error + func (t *Transaction) UpdateMap(dr *DocumentRef, data map[string]interface{}, opts ...Precondition) error + func (t *Transaction) UpdatePaths(dr *DocumentRef, data []FieldPathUpdate, opts ...Precondition) error + func (t *Transaction) UpdateStruct(dr *DocumentRef, fieldPaths []string, data interface{}, opts ...Precondition) error + type TransactionOption interface + type WriteBatch struct + func (b *WriteBatch) Commit(ctx context.Context) ([]*WriteResult, error) + func (b *WriteBatch) Create(dr *DocumentRef, data interface{}) *WriteBatch + func (b *WriteBatch) Delete(dr *DocumentRef, opts ...Precondition) *WriteBatch + func (b *WriteBatch) Set(dr *DocumentRef, data interface{}, opts ...SetOption) *WriteBatch + func (b *WriteBatch) UpdateMap(dr *DocumentRef, data map[string]interface{}, opts ...Precondition) *WriteBatch + func (b *WriteBatch) UpdatePaths(dr *DocumentRef, data []FieldPathUpdate, opts ...Precondition) *WriteBatch + func (b *WriteBatch) UpdateStruct(dr *DocumentRef, fieldPaths []string, data interface{}, opts ...Precondition) *WriteBatch + type WriteResult struct + UpdateTime time.Time