firestore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MergeAll                          = mergeSetOption{firestore.MergeAll}
	Asc                     Direction = firestore.Asc
	Desc                    Direction = firestore.Desc
	ErrBlankFirestoreClient           = errors.New("err_blankclient")
)

delegate implementation

Functions

func NewRepository

func NewRepository(client Client) raizel.Repository

Types

type Client

type Client interface {
	Close() error
	Doc(string) DocumentRef
	Collection(string) CollectionRef
	GetAll(context.Context, ...DocumentRef) ([]DocumentSnapshot, error)
	Batch() WriteBatch
}

func NewClient

func NewClient(projectID string) Client

type CollectionRef

type CollectionRef interface {
	Query
	// contains filtered or unexported methods
}

type Direction added in v0.0.2

type Direction = firestore.Direction

type DocumentIterator

type DocumentIterator interface {
	GetAll() ([]DocumentSnapshot, error)
}

type DocumentRef

type DocumentRef interface {
	Get(context.Context) (DocumentSnapshot, error)
	Set(context.Context, interface{}, ...SetOption) error
	Delete(context.Context) error
	// contains filtered or unexported methods
}

type DocumentSnapshot

type DocumentSnapshot interface {
	DataTo(interface{}) error
	Exists() bool
}

type Query

type Query interface {
	Documents(context.Context) DocumentIterator
	Where(string, string, interface{}) Query
	OrderBy(string, Direction) Query
	Offset(int) Query
	Limit(int) Query
}

type SetOption

type SetOption interface {
	// contains filtered or unexported methods
}

type WriteBatch added in v0.0.2

type WriteBatch interface {
	Set(DocumentRef, interface{}, ...SetOption) WriteBatch
	Delete(DocumentRef) WriteBatch
	Commit(context.Context) error
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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