firebase

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FirestoreConfig

type FirestoreConfig struct {
	ProjectId       string
	CredentialsFile string
	Namespace       string
}

type FirestoreStorage

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

func NewFirestoreStorage

func NewFirestoreStorage(conf *FirestoreConfig, typePtr interface{}) (*FirestoreStorage, error)

NewFirestoreStorage creates a new firestore backed storage

func (*FirestoreStorage) Close

func (f *FirestoreStorage) Close()

func (*FirestoreStorage) Create

func (f *FirestoreStorage) Create(item search.Record, additionalIndex *indexing.Key) error

Create a new record. This uses the UUIDValue for identifying records, upon creation a new UUID is generated.

func (*FirestoreStorage) CreateWithId

func (f *FirestoreStorage) CreateWithId(key *indexing.Key, item search.Record, uniqueIndexKeys *indexing.Key) error

CreateWithId creates a new record using a custom key. If a key isn't provided, a random uuid is generated in it's place, and stored in the UUIDValue field.

func (*FirestoreStorage) Find

func (f *FirestoreStorage) Find(query indexing.Query, result interface{}) error

func (*FirestoreStorage) ForEach added in v0.3.0

func (f *FirestoreStorage) ForEach(callback func(record interface{}))

func (*FirestoreStorage) GetNewest

func (f *FirestoreStorage) GetNewest(count int) []search.ExternalResultItem

GetNewest returns the latest `count` of records.

func (*FirestoreStorage) HasIndex added in v0.3.3

func (f *FirestoreStorage) HasIndex(meta *indexing.IndexMetadata) bool

func (*FirestoreStorage) Size

func (f *FirestoreStorage) Size() int64

Size is the size of the storage, as in records count

func (*FirestoreStorage) Update

func (f *FirestoreStorage) Update(query indexing.Query, item interface{}) error

Jump to

Keyboard shortcuts

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