util

package
v0.0.0-...-661c6f8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessTokenDuration  = time.Minute * 30
	RefreshTokenDuration = time.Hour * 24 * 30
)
View Source
const ProjectCacheKey = "project:%d"

Variables

View Source
var AccessTokenBuilder accessTokenBuilder
View Source
var RefreshTokenBuilder refreshTokenBuilder
View Source
var TokenBuilder tokenBuilder

Functions

func GetFirebaseUtilFromCache

func GetFirebaseUtilFromCache(pid int) (*firebaseUtil, bool)

func InitApp

func InitApp(credentials []byte, projectID string, pid int) (fu *firebaseUtil, err error)

func Validate

func Validate(token string) (*claimsBuilder, error)

Types

type AccessToken

type AccessToken string

func (AccessToken) String

func (t AccessToken) String() string

type Datetime

type Datetime string

func NowDatetime

func NowDatetime() Datetime

func TimeToDatetime

func TimeToDatetime(time time.Time) Datetime

TimeToDatetime converts `time` to `yyyy-MM-dd hh:mm:ss` formatted string

func (*Datetime) Scan

func (d *Datetime) Scan(src interface{}) error

func (Datetime) Value

func (d Datetime) Value() (driver.Value, error)

type JWT

type JWT interface {
	Token | AccessToken | RefreshToken
	String() string
}

type RefreshToken

type RefreshToken string

func (RefreshToken) String

func (t RefreshToken) String() string

type Token

type Token string

func (Token) String

func (t Token) String() string

Jump to

Keyboard shortcuts

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