firestore

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
}

Driver initializes a Firestore and returns it

func (Driver) Open

func (f Driver) Open(ctx context.Context, connection string) (store.Store, error)

Open creates the firestore struct, configures and returns it

type Firestore

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

Firestore is the storage driver to manage data for the Firebase Firestore

collection : CA Identifier that is used to split different datasets on the same storage

   id : ID of the item to retrieve
value : pointer to fill/set with the information

func (Firestore) Close

func (f Firestore) Close() error

Close releases the resources associated with the Store.

func (Firestore) Delete

func (f Firestore) Delete(ctx context.Context, collection, id string) (ok bool, err error)

Delete removes the required ID on the dataset

func (Firestore) Get

func (f Firestore) Get(ctx context.Context, collection, id string, value interface{}) (err error)

Get retrieves a value from the storage and unmarshals it to the required type

func (Firestore) GetAll

func (f Firestore) GetAll(ctx context.Context, collection string) (values []map[string]interface{}, err error)

GetAll retrieves all the items for the required dataset

func (Firestore) Ping

func (f Firestore) Ping(ctx context.Context) error

Ping returns a non-nil error if the Store is not healthy or if the connection to the persistence is compromised.

func (Firestore) Set

func (f Firestore) Set(ctx context.Context, collection, id string, value interface{}) (err error)

Set inserts/updates a item in the dataset

Jump to

Keyboard shortcuts

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