Documentation
¶
Overview ¶
Package fuego provides the necessary to create a client.
Usage ¶
Create a fuego client:
fuegoClient := fuego.New(firestoreClient) /// Your code here...
Note: firestoreClient needs to be created beforehand.
Index ¶
- Variables
- type Fuego
- func (f *Fuego) CancelBatch()
- func (f *Fuego) Collection(path string) *collection.FirestoreCollection
- func (f *Fuego) CommitBatch(ctx context.Context) ([]*firestore.WriteResult, error)
- func (f *Fuego) Document(path, documentID string) *document.FirestoreDocument
- func (f *Fuego) DocumentWithGeneratedID(path string) *document.FirestoreDocument
- func (f *Fuego) StartBatch()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBatchWriteNotStarted indicates that the a commit can't happen if the batch write hasn't been started. ErrBatchWriteNotStarted = errors.New("fuego: no batch write started") )
Functions ¶
This section is empty.
Types ¶
type Fuego ¶
type Fuego struct { // FirestoreClient is a ptr to a firestore client. FirestoreClient *firestore.Client // WriteBatch is a ptr to a writebatch. // will be nil if not started with StartBatch() or cancelled with CancelBatch(). WriteBatch *firestore.WriteBatch }
Fuego is a wrapper for the Firestore client. Contains the Firestore client.
func (*Fuego) CancelBatch ¶
func (f *Fuego) CancelBatch()
CancelBatch cancels an on-going write batch (if any).
func (*Fuego) Collection ¶
func (f *Fuego) Collection(path string) *collection.FirestoreCollection
Collection returns a new FirestoreCollection.
func (*Fuego) CommitBatch ¶
CommitBatch commits the write batch previously started with StartBatch().
func (*Fuego) Document ¶
func (f *Fuego) Document(path, documentID string) *document.FirestoreDocument
Document returns a new FirestoreDocument.
func (*Fuego) DocumentWithGeneratedID ¶
func (f *Fuego) DocumentWithGeneratedID(path string) *document.FirestoreDocument
DocumentWithGeneratedID returns a new FirestoreDocument without ID.
func (*Fuego) StartBatch ¶
func (f *Fuego) StartBatch()
StartBatch starts a write batch. Write operations that follow will be added to the batch and processed when CommitBatch is called.
Directories
¶
Path | Synopsis |
---|---|
Package collection provides generic methods to interact with Firestore collections.
|
Package collection provides generic methods to interact with Firestore collections. |
Package document provides generic methods to interact with Firestore documents.
|
Package document provides generic methods to interact with Firestore documents. |
Click to show internal directories.
Click to hide internal directories.