firebase

package
v0.0.0-...-46fdcb5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRestClient

type APIRestClient struct {
	*http.Client
	Endpoint string
	APIKey   string
}

@see https://firebase.google.com/docs/reference/rest/auth

type Client

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

func NewClient

func NewClient(secret string, endpoint string, key string) *Client

func (*Client) ChangePassword

func (f *Client) ChangePassword(ctx context.Context, uid, password string) error

func (*Client) CreateUser

func (c *Client) CreateUser(ctx context.Context, userID, email, password string) error

func (*Client) DeleteUser

func (f *Client) DeleteUser(ctx context.Context, uid string) error

func (*Client) Login

func (f *Client) Login(ctx context.Context, email, password string) (SignInResponse, error)

func (*Client) RefreshToken

func (f *Client) RefreshToken(ctx context.Context, refresh string) (string, error)

func (*Client) VerifyIDToken

func (f *Client) VerifyIDToken(ctx context.Context, idToken string) error

type Firebase

type Firebase struct{}

func New

func New() *Firebase

func (*Firebase) Of

func (fb *Firebase) Of(
	secret string,
	endpoint string,
	apiKey string,
) (*external.Auth, error)

type RefreshRequest

type RefreshRequest struct {
	GrantType    string `json:"grant_type"`
	RefreshToken string `json:"refresh_token"`
}

type RefreshResponse

type RefreshResponse struct {
	ExpiresIn    string `json:"expires_in"`
	TokenType    string `json:"token_type"`
	RefreshToken string `json:"refresh_token"`
	IDToken      string `json:"id_token"`
	UserID       string `json:"user_id"`
	ProjectID    string `json:"project_id"`
}

type SignInRequest

type SignInRequest struct {
	Email             string `json:"email"`
	Password          string `json:"password"`
	ReturnSecureToken bool   `json:"returnSecureToken"`
}

type SignInResponse

type SignInResponse struct {
	ExpiresIn    string `json:"expiresIn"`
	LocalID      string `json:"localId"`
	IDToken      string `json:"idToken"`
	RefreshToken string `json:"refreshToken"`
}

Jump to

Keyboard shortcuts

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