firebase

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentType

func ContentType(fh *multipart.FileHeader) string

func Extension

func Extension(fh *multipart.FileHeader) (string, error)

Types

type Config

type Config struct {
	CredentialsFile string `env:"FIREBASE_CREDENTIALS_FILE,required"`
	DatabaseUrl     string `env:"FIREBASE_DATABASE_URL,required"`
	StorageBucket   string `env:"FIREBASE_STORAGE_BUCKET,required"`
}

func NewConfig

func NewConfig() (*Config, error)

type Firebase

type Firebase struct {
	Auth      *auth.Client
	Database  *db.Client
	Storage   *storage.Client
	Messaging *messaging.Client
}

func NewFirebase

func NewFirebase(config *Config) (*Firebase, error)

func (*Firebase) UploadFile

func (c *Firebase) UploadFile(ctx context.Context, file multipart.File, name, contentType string) (string, error)

Jump to

Keyboard shortcuts

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