You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
570 B
29 lines
570 B
package google_auth
|
|
|
|
import (
|
|
"context"
|
|
|
|
"firebase.google.com/go/v4/auth"
|
|
)
|
|
|
|
type (
|
|
ISys interface {
|
|
Auth(ctx context.Context, idToken string) (info *auth.Token, err error)
|
|
}
|
|
)
|
|
|
|
var defsys ISys
|
|
|
|
func OnInit(config map[string]interface{}, option ...Option) (err error) {
|
|
defsys, err = newSys(newOptions(config, option...))
|
|
return
|
|
}
|
|
|
|
func NewSys(option ...Option) (sys ISys, err error) {
|
|
sys, err = newSys(newOptionsByOption(option...))
|
|
return
|
|
}
|
|
|
|
func Auth(ctx context.Context, idToken string) (info *auth.Token, err error) {
|
|
return defsys.Auth(ctx, idToken)
|
|
}
|
|
|