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

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

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

Directories

Path Synopsis
internal