firebase

package module
v0.0.0-...-6a24f66 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2018 License: MIT Imports: 2 Imported by: 0

README

Firebase

GopherJS bindings for Firebase.

Current Status

under construction.

Documentation

Index

Constants

View Source
const (
	Local   Persistence = "LOCAL"
	None    Persistence = "NONE"
	Session Persistence = "SESSION"

	PasswordReset Operation = "PASSWORD_RESET"
	VerifyEmail   Operation = "VERIFY_EMAIL"
	RecoverEmail  Operation = "RECOVERY_EMAIL"
)
View Source
const SDKVersion = "4.8.1"

Variables

This section is empty.

Functions

func Name

func Name(name string) func(*App)

Types

type ActionCodeInfo

type ActionCodeInfo struct {
	*js.Object
	Operation Operation `js:"operation"`
	Data      struct {
		Email     string `js:"email"`
		FromEmail string `js:"fromEmail"`
	} `js:"data"`
}

type AdditionalUserInfo

type AdditionalUserInfo struct {
	*js.Object
	ProviderID string     `js:"providerId"`
	Profile    *js.Object `js:"profile"`
	Username   string     `js:"username"`
	IsNewUser  bool       `js:"isNewUser"`
}

type App

type App struct {
	*js.Object
	Name    string   `js:"name"`
	Options *Options `js:"options"`
}

func NewApp

func NewApp(options *Options, opts ...func(*App)) (*App, error)

func (*App) Auth

func (a *App) Auth() *Auth

func (*App) Delete

func (a *App) Delete() error

func (*App) Firestore

func (a *App) Firestore() *Firestore

type ApplicationVerifier

type ApplicationVerifier struct {
	*js.Object
	Type string `js:"type"`
}

func (*ApplicationVerifier) Verify

func (a *ApplicationVerifier) Verify() (string, error)

type Auth

type Auth struct {
	*js.Object
	Persistence  Persistence `js:"Persistence"`
	App          *App        `js:"app"`
	CurrentUser  *User       `js:"currentUser"`
	LanguageCode string      `js:"languageCode"`
}

func (*Auth) ApplyActionCode

func (a *Auth) ApplyActionCode(code string) error

func (*Auth) CheckActionCode

func (a *Auth) CheckActionCode(code string) (*ActionCodeInfo, error)

func (*Auth) ConfirmPasswordReset

func (a *Auth) ConfirmPasswordReset(code string, newPassword string) error

func (*Auth) CreateUserAndRetrieveDataWithEmailAndPassword

func (a *Auth) CreateUserAndRetrieveDataWithEmailAndPassword(email string, password string) (*UserCredential, error)

func (*Auth) CreateUserWithEmailAndPassword

func (a *Auth) CreateUserWithEmailAndPassword(email string, password string) (*User, error)

func (*Auth) FetchProvidersForEmail

func (a *Auth) FetchProvidersForEmail(email string) (*js.Object, error)

func (*Auth) OnAuthStateChanged

func (a *Auth) OnAuthStateChanged(next func(*User), args ...interface{}) *js.Object

func (*Auth) OnIDTokenChanged

func (a *Auth) OnIDTokenChanged(next func(*User), args ...interface{}) *js.Object

func (*Auth) SendPasswordResetEmail

func (a *Auth) SendPasswordResetEmail(email, actionCodeSettings string) error

func (*Auth) SetPersistence

func (a *Auth) SetPersistence(persistence Persistence) error

func (*Auth) SignInAndRetrieveDataWithCredential

func (a *Auth) SignInAndRetrieveDataWithCredential(credential *AuthCredential) (*UserCredential, error)

func (*Auth) SignInAndRetrieveDataWithCustomToken

func (a *Auth) SignInAndRetrieveDataWithCustomToken(token string) (*UserCredential, error)

func (*Auth) SignInAndRetrieveDataWithEmailAndPassword

func (a *Auth) SignInAndRetrieveDataWithEmailAndPassword(email, password string) (*UserCredential, error)

func (*Auth) SignInAnonymously

func (a *Auth) SignInAnonymously() (*User, error)

func (*Auth) SignInAnonymouslyAndRetrieveData

func (a *Auth) SignInAnonymouslyAndRetrieveData() (*UserCredential, error)

func (*Auth) SignInWithCustomToken

func (a *Auth) SignInWithCustomToken(token string) (*User, error)

func (*Auth) SignInWithEmailAndPassword

func (a *Auth) SignInWithEmailAndPassword(email, password string) (*User, error)

func (*Auth) SignInWithPhoneNumber

func (a *Auth) SignInWithPhoneNumber(phoneNumber string, applicationVerifier *ApplicationVerifier) (*ConfirmationResult, error)

func (*Auth) SignOut

func (a *Auth) SignOut() error

func (*Auth) UseDeviceLanguage

func (a *Auth) UseDeviceLanguage()

func (*Auth) VerifyPasswordResetCode

func (a *Auth) VerifyPasswordResetCode(code string) (string, error)

type AuthCredential

type AuthCredential struct {
	*js.Object
	ProviderID string `js:"providerId"`
}

type CollectionReference

type CollectionReference struct {
	*FirestoreQuery
	ID     string             `js:"id"`
	Parent *DocumentReference `js:"parent"`
}

func (*CollectionReference) Add

func (c *CollectionReference) Add(data interface{}) (*DocumentReference, error)

type ConfirmationResult

type ConfirmationResult struct {
	*js.Object
	VerificationID string `js:"verificationId"`
}

func (*ConfirmationResult) Confirm

func (c *ConfirmationResult) Confirm(verificationCode string) (*UserCredential, error)

type DocumentChange

type DocumentChange struct {
	*js.Object
}

type DocumentReference

type DocumentReference struct {
	*js.Object
	Firestore *Firestore           `js:"firestore"`
	ID        string               `js:"id"`
	Parent    *CollectionReference `js:"parent"`
}

func (*DocumentReference) Collection

func (d *DocumentReference) Collection(collectionPath string) *CollectionReference

func (*DocumentReference) Delete

func (d *DocumentReference) Delete() *Promise

func (*DocumentReference) Get

func (d *DocumentReference) Get() *Promise

func (*DocumentReference) OnSnapshot

func (d *DocumentReference) OnSnapshot(args ...interface{})

func (*DocumentReference) Set

func (d *DocumentReference) Set(data interface{}, options interface{}) *Promise

func (*DocumentReference) Update

func (d *DocumentReference) Update(args ...interface{}) *Promise

type DocumentSnapshot

type DocumentSnapshot struct {
	*js.Object
	Exists   string                    `js:"exists"`
	ID       string                    `js:"id"`
	Metadata FirestoreSnapshotMetadata `js:"metadata"`
	Ref      *DocumentReference        `js:"ref"`
}

func (*DocumentSnapshot) Data

func (d *DocumentSnapshot) Data() *js.Object

func (*DocumentSnapshot) Get

func (d *DocumentSnapshot) Get(fieldPath string) *js.Object

type Error

type Error struct {
	*js.Object
	Code    string `js:"code"`
	Message string `js:"message"`
	Name    string `js:"name"`
	Stack   string `js:"stack"`
}

func (Error) Error

func (e Error) Error() string

type Firestore

type Firestore struct {
	*js.Object
	App *App `js:"app"`
}

func (*Firestore) Batch

func (f *Firestore) Batch() *WriteBatch

func (*Firestore) Collection

func (f *Firestore) Collection(collectionPath string) *CollectionReference

func (*Firestore) Doc

func (f *Firestore) Doc(documentPath string) *DocumentReference

func (*Firestore) EnablePersistence

func (f *Firestore) EnablePersistence() error

func (*Firestore) RunTransaction

func (f *Firestore) RunTransaction(updateFunc func(*Transaction)) error

func (*Firestore) SetLogLevel

func (f *Firestore) SetLogLevel(logLevel string)

func (*Firestore) Settings

func (f *Firestore) Settings(settings map[string]string)

type FirestoreQuery

type FirestoreQuery struct {
	*js.Object
	Firestore *Firestore `js:"firestore"`
}

func (*FirestoreQuery) EndAt

func (q *FirestoreQuery) EndAt(args ...interface{}) *FirestoreQuery

func (*FirestoreQuery) EndBefore

func (q *FirestoreQuery) EndBefore(args ...interface{}) *FirestoreQuery

func (*FirestoreQuery) Get

func (q *FirestoreQuery) Get(args ...interface{}) *FirestoreQuerySnapshot

func (*FirestoreQuery) Limit

func (q *FirestoreQuery) Limit(limit int) *FirestoreQuery

func (*FirestoreQuery) OrderBy

func (q *FirestoreQuery) OrderBy(fieldPath string, directionStr *string) *FirestoreQuery

func (*FirestoreQuery) StartAfter

func (q *FirestoreQuery) StartAfter(args ...interface{}) *FirestoreQuery

func (*FirestoreQuery) StartAt

func (q *FirestoreQuery) StartAt(args ...interface{}) *FirestoreQuery

func (*FirestoreQuery) Where

func (q *FirestoreQuery) Where(fieldPath string, opStr string, value interface{}) *FirestoreQuery

type FirestoreQueryMetadata

type FirestoreQueryMetadata struct {
	*js.Object
	FromCache        bool `js:"fromCache"`
	HasPendingWrites bool `js:"hasPendingWrites"`
}

type FirestoreQuerySnapshot

type FirestoreQuerySnapshot struct {
	*js.Object
	DocChanges []*DocumentChange       `js:"docChanges"`
	Docs       []*DocumentSnapshot     `js:"docs"`
	Empty      bool                    `js:"empty"`
	Metadata   *FirestoreQueryMetadata `js:"metadata"`
	Query      *FirestoreQuery         `js:"query"`
	Size       int                     `js:"size"`
}

func (*FirestoreQuerySnapshot) ForEach

func (q *FirestoreQuerySnapshot) ForEach(callback func(*DocumentSnapshot), thisArg *js.Object)

type FirestoreSnapshotMetadata

type FirestoreSnapshotMetadata struct {
	*js.Object
	FromCache        bool `js:"fromCache"`
	HasPendingWrites bool `js:"hasPendingWrites"`
}

type GeoPoint

type GeoPoint struct {
	*js.Object
	Latitude  string `js:"latitude"`
	Longitude string `js:"longitude"`
}

func NewGeoPoint

func NewGeoPoint(latitude, longitude int) *GeoPoint

type OAuthCredential

type OAuthCredential struct {
	*AuthCredential
	AccessToken string `js:"accessToken"`
	IDToken     string `js:"idToken"`
	Secret      string `js:"secret"`
}

type Operation

type Operation string

type Options

type Options struct {
	APIKey            string
	AuthDomain        string
	DatabaseURL       string
	ProjectID         string
	StorageBucket     string
	MessagingSenderID string
}

type Persistence

type Persistence string

type Promise

type Promise struct {
	*js.Object
}

func (*Promise) All

func (p *Promise) All(values ...interface{}) *Promise

func (*Promise) Catch

func (p *Promise) Catch(onReject ...interface{}) *Promise

func (*Promise) Convert

func (p *Promise) Convert() error

func (*Promise) ConvertWithResult

func (p *Promise) ConvertWithResult() (*js.Object, error)

func (*Promise) Reject

func (p *Promise) Reject(err interface{}) *Promise

func (*Promise) Resolve

func (p *Promise) Resolve(value interface{}) *Promise

func (*Promise) Then

func (p *Promise) Then(args ...interface{}) *Promise

type Transaction

type Transaction struct {
	*js.Object
}

func (*Transaction) Delete

func (t *Transaction) Delete() *Transaction

func (*Transaction) Get

func (t *Transaction) Get(documentRef *DocumentReference) (*DocumentSnapshot, error)

func (*Transaction) Set

func (t *Transaction) Set(documentRef *DocumentReference, data interface{}, options interface{}) *Transaction

func (*Transaction) Update

func (t *Transaction) Update(documentRef *DocumentReference, args ...interface{}) *Transaction

type User

type User struct {
	*UserInfo
	EmailVerified bool          `js:"emailVerified"`
	IsAnonymous   bool          `js:"isAnonymous"`
	Metadata      *UserMetadata `js:"metadata"`
	ProviderData  []UserInfo    `js:"providerData"`
	RefreshToken  string        `js:"refreshToken"`
}

type UserCredential

type UserCredential struct {
	*js.Object
	User               *User               `js:"user"`
	Credential         *AuthCredential     `js:"credential"`
	OperationType      string              `js:"operationType"`
	AdditionalUserInfo *AdditionalUserInfo `js:"additionalUserInfo"`
}

type UserInfo

type UserInfo struct {
	*js.Object
	DisplayName string `js:"displayName"`
	Email       string `js:"email"`
	PhoneNumber string `js:"phoneNumber"`
	PhotoURL    string `js:"photoURL"`
	ProviderID  string `js:"provierId"`
	UID         string `js:"uid"`
}

type UserMetadata

type UserMetadata struct {
	*js.Object
	CreationTime   string `js:"creationTime"`
	LastSignInTime string `js:"lastSignInTime"`
}

type WriteBatch

type WriteBatch struct {
	*js.Object
}

func (*WriteBatch) Commit

func (w *WriteBatch) Commit() error

func (*WriteBatch) Delete

func (w *WriteBatch) Delete() *WriteBatch

func (*WriteBatch) Set

func (w *WriteBatch) Set(documentRef *DocumentReference) *WriteBatch

func (*WriteBatch) Update

func (w *WriteBatch) Update(documentRef *DocumentReference, args ...interface{}) *WriteBatch

Jump to

Keyboard shortcuts

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