firebase

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AUTH_UID_OP    = "uid"
	AUTH_EMAIL_OP  = "email"
	AUTH_PHOME_OP  = "phone"
	AUTH_CREATE_OP = "create"
	AUTH_UPDATE_OP = "update"
	AUTH_DELETE_OP = "delete"
	AUTH_LIST_OP   = "list"
)
View Source
const (
	DB_QUERY_OP  = "query"
	DB_SET_OP    = "set"
	DB_UPDATE_OP = "update"
	DB_APPEND_OP = "append"
)
View Source
const (
	FS_QUERY_FS_OP   = "query_fs"
	FS_INSERT_DOC_OP = "insert_doc"
	FS_UPDATE_DOC_OP = "update_doc"
	FS_GET_DOC_OP    = "get_doc"
	FS_DELETE_DOC_OP = "delete_doc"
	FS_GET_COLLS_OP  = "get_colls"
	FS_QUERY_COLL_OP = "query_coll"
)
View Source
const (
	AUTH_SERVICE      = "auth"
	DATABASE_SERVICE  = "database"
	FIRESTORE_SERVICE = "firestore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Service   string                 `validate:"required,oneof=firestore database auth"`
	Operation string                 `validate:"required"`
	Options   map[string]interface{} `validate:"required"`
}

type AuthBaseOptions

type AuthBaseOptions struct {
	Filter string `validate:"required"`
}

type AuthCreateOptions

type AuthCreateOptions struct {
	Object UserObject `validate:"required"`
}

type AuthListOptions

type AuthListOptions struct {
	Number int
	Token  string
}

type AuthOperationRunner

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

type AuthUpdateOptions

type AuthUpdateOptions struct {
	UID    string     `validate:"required"`
	Object UserObject `validate:"required"`
}

type Connector

type Connector struct {
	ResourceOpts Resource
	ActionOpts   Action
}

func (*Connector) GetMetaInfo

func (f *Connector) GetMetaInfo(resourceOptions map[string]interface{}) (common.MetaInfoResult, error)

GetMetaInfo get the collections in firestore

func (*Connector) Run

func (f *Connector) Run(resourceOptions map[string]interface{}, actionOptions map[string]interface{}) (common.RuntimeResult, error)

func (*Connector) TestConnection

func (f *Connector) TestConnection(resourceOptions map[string]interface{}) (common.ConnectionResult, error)

func (*Connector) ValidateActionOptions

func (f *Connector) ValidateActionOptions(actionOptions map[string]interface{}) (common.ValidateResult, error)

func (*Connector) ValidateResourceOptions

func (f *Connector) ValidateResourceOptions(resourceOptions map[string]interface{}) (common.ValidateResult, error)

type DBOperationRunner

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

type DBOptions

type DBOptions struct {
	Ref    string
	Object map[string]interface{}
}

type FSDocIDOptions

type FSDocIDOptions struct {
	Collection string `validate:"required"`
	ID         string `validate:"required"`
}

type FSDocValueOptions

type FSDocValueOptions struct {
	Collection string `validate:"required"`
	ID         string
	Value      map[string]interface{} `validate:"required"`
}

type FSGetCollsOptions

type FSGetCollsOptions struct {
	Parent string
}

type FSQueryOptions

type FSQueryOptions struct {
	Collection     string `validate:"required"`
	CollectionType string `validate:"oneof=select input"`
	Where          []QueryCondition
	Limit          int
	OrderBy        string
	OrderDirection string
	StartAt        SimpleCursor `validate:"required"`
	EndAt          SimpleCursor `validate:"required"`
}

type FirestoreOperationRunner

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

type QueryCondition

type QueryCondition struct {
	Field     string
	Condition string
	Value     interface{}
}

type Resource

type Resource struct {
	DatabaseURL string                 `validate:"required,url"`
	ProjectID   string                 `validate:"required"`
	PrivateKey  map[string]interface{} `validate:"required"`
}

type SimpleCursor

type SimpleCursor struct {
	Trigger bool
	Value   interface{}
}

type UserObject

type UserObject struct {
	UID           string
	Email         string
	EmailVerified bool
	PhoneNumber   string
	Password      string
	DisplayName   string
	PhotoURL      string
	Disabled      bool
}

Jump to

Keyboard shortcuts

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