firestore

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExists   = fmt.Errorf("[FireStore] Path exists")
	ErrInvalid  = fmt.Errorf("[FireStore] Invalid Path! (collections should have odd path elements and docs should have even)")
	ErrNotFound = fmt.Errorf("[FireStore] Path Not Found")
)

Functions

This section is empty.

Types

type Condition

type Condition struct {
	Path   string
	Op     string
	Value  any
	Offset int
	Limit  int
}

type Document

type Document struct {
	Path string
	Data map[string]any
}

type FireStore

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

func New

func New(ctx context.Context, project string, options ...Option) (*FireStore, error)

func (*FireStore) AtomicAdd added in v1.0.24

func (f *FireStore) AtomicAdd(ctx context.Context, path, field string, amount any) error

func (*FireStore) Create

func (f *FireStore) Create(ctx context.Context, path string, data map[string]any) error

func (*FireStore) Delete

func (f *FireStore) Delete(ctx context.Context, path string) error

func (*FireStore) Get

func (f *FireStore) Get(ctx context.Context, path string) (map[string]any, error)

func (*FireStore) List

func (f *FireStore) List(ctx context.Context, path string, condition *Condition) ([]*Document, error)

func (*FireStore) RawCollectionRef added in v1.0.23

func (f *FireStore) RawCollectionRef(ctx context.Context, path string) (*firestore.CollectionRef, error)

func (*FireStore) Set

func (f *FireStore) Set(ctx context.Context, path string, data map[string]any) error

type Option

type Option func(*FireStore)

func WithDatabase

func WithDatabase(database string) Option

func WithNamespace

func WithNamespace(namespace string) Option

Jump to

Keyboard shortcuts

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