service

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ParseService = &parseService{}
	OauthService = &oauthService{}
)

服务类service实例instance

① 本质是一个结构体零值指针
② 定义结构体不可导出,然后实例化一个零值结构体变量导出作为service实例使用
③ 结构体的实例变量和结构体类型仅首字母大小写不一样[变量可导出,类型不可导出]
View Source
var (
	AuthorizationHasExpiredOrInvalid = errors.New("authorization has expired or invalid")
	AuthorizationParamInvalid        = errors.New("callback URL needed params is missing")
	LoginFailed                      = errors.New("some error occurred, login failed")
	EmailIsNotAllow                  = errors.New("your email account is not allowed to log in")
)

Functions

This section is empty.

Types

type Data

type Data struct {
	Items map[string][]Swagger
	Table map[string]string
}

Data swagger json file Data info

type JwtToken

type JwtToken struct {
	Sub string `json:"sub"` // JWT subject, just use oauth email, such as google email address
	Exp int64  `json:"exp"` // JWT expired unix timestamp
	Iat int64  `json:"iat"` // JWT issue unix timestamp
}

JwtToken jwt token struct

type Swagger

type Swagger struct {
	OpenVersion string // openapi version
	Version     string // swagger doc version
	Title       string // swagger title
	Desc        string // swagger desc
	Name        string // swagger concat name
	Email       string // swagger concat email
	Icon        string // swagger title first letter
	Path        string // json file path detail
	Hash        string // json file path hash
	Key         int    // css icon bg num
}

Swagger parsed swagger file item

type Token

type Token struct {
	Email         string `json:"email"`
	Authenticated bool   `json:"authenticated"`
	ShouldLogin   bool   `json:"should_login"`
}

Token request token

Jump to

Keyboard shortcuts

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