authorizer

package
v1.0.33 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	Name() string
	GetAccessToken(kratosx.Context, GetAccessTokenRequest) (*GetAccessTokenReply, error)
	GetAuthInfo(kratosx.Context, GetAuthInfoRequest) (*GetAuthInfoReply, error)
}

type Config

type Config struct {
	Ak       string
	Sk       string
	Code     string
	Extra    string
	Platform string
}

type GetAccessTokenReply

type GetAccessTokenReply struct {
	Token  string
	Expire int64
}

type GetAccessTokenRequest

type GetAccessTokenRequest struct {
	Ak    string
	Sk    string
	Extra string
	Code  string
}

type GetAuthInfoReply

type GetAuthInfoReply struct {
	AuthId  string
	UnionId *string
}

type GetAuthInfoRequest

type GetAuthInfoRequest struct {
	Ak    string
	Sk    string
	Extra string
	Code  string
	Token string
}

type Interface

type Interface interface {
	GetAuthorizers() map[string]Authorizer
	GetToken(ctx kratosx.Context) (*GetAccessTokenReply, error)
	GetAuthInfo(ctx kratosx.Context, token string) (*GetAuthInfoReply, error)
}

func New

func New(config *Config) Interface

Jump to

Keyboard shortcuts

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