firebase

package
v0.0.0-...-9c552bb Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FirestoreCollection = "firestore"
	UsersCollection     = "users"
)

Variables

This section is empty.

Functions

func NewFirebase

func NewFirebase(ctx context.Context, sourceConfig *base.SourceConfig, collection *base.Collection) (base.Driver, error)

NewFirebase returns configured Firebase driver instance

func TestFirebase

func TestFirebase(sourceConfig *base.SourceConfig) error

TestFirebase tests connection to Firebase without creating Driver instance

Types

type Firebase

type Firebase struct {
	base.IntervalDriver
	// contains filtered or unexported fields
}

Firebase is a Firebase/Firestore driver. It used in syncing data from Firebase/Firestore

func (*Firebase) Close

func (f *Firebase) Close() error

func (*Firebase) GetAllAvailableIntervals

func (f *Firebase) GetAllAvailableIntervals() ([]*base.TimeInterval, error)

func (*Firebase) GetCollectionMetaKey

func (f *Firebase) GetCollectionMetaKey() string

func (*Firebase) GetCollectionTable

func (f *Firebase) GetCollectionTable() string

func (*Firebase) GetObjectsFor

func (f *Firebase) GetObjectsFor(interval *base.TimeInterval, objectsLoader base.ObjectsLoader) error

func (*Firebase) GetRefreshWindow

func (f *Firebase) GetRefreshWindow() (time.Duration, error)

func (*Firebase) Type

func (f *Firebase) Type() string

type FirebaseConfig

type FirebaseConfig struct {
	ProjectID   string `mapstructure:"project_id" json:"project_id,omitempty" yaml:"project_id,omitempty"`
	Credentials string `mapstructure:"key" json:"key,omitempty" yaml:"key,omitempty"`
}

FirebaseConfig is a Firebase configuration dto for serialization

func (*FirebaseConfig) Validate

func (fc *FirebaseConfig) Validate() error

Validate returns err if configuration is invalid

type FirestoreParameters

type FirestoreParameters struct {
	FirestoreCollection string `mapstructure:"collection" json:"collection,omitempty" yaml:"collection,omitempty"`
}

FirestoreParameters is a Firebase Firestore configuration dto for serialization

func (*FirestoreParameters) Validate

func (fp *FirestoreParameters) Validate() error

Validate returns err if configuration is invalid

Jump to

Keyboard shortcuts

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