config

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseTokeStoreSetting

type DatabaseTokeStoreSetting struct {
	Database    string `json:"database" yaml:"database"`
	TablePrefix string `json:"tablePrefix" yaml:"tablePrefix"`
}

type FileTokeStoreSetting

type FileTokeStoreSetting struct {
	FileName string `json:"fileName" yaml:"fileName"`
}

type RedisTokenStoreSetting

type RedisTokenStoreSetting struct {
	Database  int    `json:"database" yaml:"database"`
	KeyPrefix string `json:"keyPrefix" yaml:"keyPrefix"`
}

type TokeStoreSetting

type TokeStoreSetting struct {
	Mode     string                    `json:"mode" yaml:"mode"`
	Redis    *RedisTokenStoreSetting   `json:"redis" yaml:"redis"`
	Database *DatabaseTokeStoreSetting `json:"database" yaml:"database"`
	File     *FileTokeStoreSetting     `json:"file" yaml:"file"`
}

type TokenSetting

type TokenSetting struct {
	BindContextKey         string            `json:"bindContextKey"`
	HeaderTokenKey         string            `json:"headerTokenKey"`
	Cache                  bool              `json:"cache"`
	Store                  *TokeStoreSetting `json:"store" yaml:"store"`
	OnlineUsers            int               `json:"onlineUsers" yaml:"onlineUsers"`
	ReuseAccessToken       bool              `json:"reuseAccessToken" yaml:"reuseAccessToken"`
	ReuseRefreshToken      bool              `json:"reuseRefreshToken" yaml:"reuseRefreshToken"`
	AccessTokenExpireTime  time.Duration     `json:"accessTokenExpireTime" yaml:"accessTokenExpireTime"`
	RefreshTokenExpireTime time.Duration     `json:"refreshTokenExpireTime" yaml:"refreshTokenExpireTime"`
	UseJwtToken            bool              `json:"useJwtToken"`
	Jwt                    *jwt.JwtSetting   `json:"jwt" yaml:"jwt"`
}
var Setting *TokenSetting = &TokenSetting{
	OnlineUsers:            10,
	ReuseAccessToken:       true,
	ReuseRefreshToken:      true,
	AccessTokenExpireTime:  time.Hour * 8,
	RefreshTokenExpireTime: time.Hour * 24 * 100,

	Store: &TokeStoreSetting{
		Mode: "default",
	},
}

Jump to

Keyboard shortcuts

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