firebase

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: LGPL-2.1 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticatedUserInfo added in v0.0.3

type AuthenticatedUserInfo struct {
	DisplayName string `json:"displayName,omitempty"`
	Email       string `json:"email,omitempty"`
	PhoneNumber string `json:"phoneNumber,omitempty"`
	PhotoURL    string `json:"photoUrl,omitempty"`
	// In the ProviderUserInfo[] ProviderID can be a short domain name (e.g. google.com),
	// or the identity of an OpenID identity provider.
	// In UserRecord.UserInfo it will return the constant string "firebase".
	ProviderID string `json:"providerId,omitempty"`
	UID        string `json:"rawId,omitempty"`
}

AuthenticatedUserInfo represents the authenticated user reflects to the firebase user record

type AuthenticationResponse

type AuthenticationResponse struct {
	Context          string `json:"context"`
	DisplayName      string `json:"displayName"`
	Email            string `json:"email"`
	EmailVerified    bool   `json:"emailVerified"`
	ExpiresIn        string `json:"expiresIn"`
	FederatedID      string `json:"federatedId"`
	FirstName        string `json:"firstName"`
	FullName         string `json:"fullName"`
	IDToken          string `json:"idToken"`
	IsNewUser        bool   `json:"isNewUser"`
	Kind             string `json:"kind"`
	LocalID          string `json:"localId"`
	OauthAccessToken string `json:"oauthAccessToken"`
	OauthExpireIn    int64  `json:"oauthExpireIn"`
	OauthIDToken     string `json:"oauthIdToken"`
	PhotoURL         string `json:"photoUrl"`
	ProviderID       string `json:"providerId"`
	RawUserInfo      string `json:"rawUserInfo"`
	RefreshToken     string `json:"refreshToken"`
}

AuthenticationResponse represents the response from firebase authentication

type Config

type Config struct {
	FirebaseCredentials string // the path to the firebase credentials JSON file
}

Config represents the configuration

type Service

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

Service represents the firebase service

func New

func New(cfg *Config) *Service

New initializes firebase service with default config

func (*Service) CreateUser added in v0.0.3

func (s *Service) CreateUser(email, password string) (*auth.UserRecord, error)

CreateUser creates a new user with the specified email and password

func (*Service) GetUser added in v0.0.3

func (s *Service) GetUser(identifier string, value interface{}) (*auth.UserRecord, error)

GetUser returns user record by UID, email, or phone number

Jump to

Keyboard shortcuts

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