wrapper

package
Version: v0.0.0-...-161b44b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionRef

type CollectionRef struct {
	// contains filtered or unexported fields
}

CollectionRef is a wrapper around firestore's CollectionRef

func (CollectionRef) Documents

Documents will return an iterator for fetching all of the documents

func (CollectionRef) NewDoc

func (cr CollectionRef) NewDoc() DocRefInterface

NewDoc will generate and return a new document

type CollectionRefInterface

type CollectionRefInterface interface {
	NewDoc() DocRefInterface
	Documents(ctx context.Context) DocumentInteratorInterface
}

CollectionRefInterface for firestore

type DBClient

type DBClient struct {
	// contains filtered or unexported fields
}

DBClient is a wrapper around the firestore client

func (DBClient) Collection

func (dbc DBClient) Collection(path string) CollectionRefInterface

Collection will return a collection reference

type DBClientInterface

type DBClientInterface interface {
	Collection(path string) CollectionRefInterface
}

DBClientInterface is an interface that mimics the firestore client

func NewClient

func NewClient(ctx context.Context, projectID string) (DBClientInterface, error)

NewClient will return a firestore client

type DocRefInterface

type DocRefInterface interface {
	Set(ctx context.Context, data interface{}, opts ...firestore.SetOption) (*firestore.WriteResult, error)
}

DocRefInterface is a wrapper around DocRef

type DocumentInteratorInterface

type DocumentInteratorInterface interface {
	Next() (*firestore.DocumentSnapshot, error)
}

DocumentInteratorInterface is a wrapper around firestore's document iterator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL