g

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION   = "0.2.0"
	UserAgent = "Open-OAuth2Playground"
)

Variables

View Source
var (
	ConfigFile string
)

Functions

func InitLog

func InitLog(l LoggerSection)

func ParseConfig

func ParseConfig(cfg string)

ParseConfig 加载配置

Types

type EndpointConfig

type EndpointConfig struct {
	Authorization string `json:"authorization"`
	Token         string `json:"token"`
	Userinfo      string `json:"userinfo"`
}

EndpointConfig oauth endpoint 配置

type GlobalConfig

type GlobalConfig struct {
	Logger       LoggerSection  `json:"logger"`
	Endpoints    EndpointConfig `json:"endpoints"`
	IpLimit      IpLimitConfig  `json:"iplimit"`
	Http         HttpConfig     `json:"http"`
	TrustDomain  []string       `json:"trust_domain"`
	DefaultScope string         `json:"default_scope"`
	Timeout      int            `json:"timeout"`
}

GlobalConfig 全局配置

func Config

func Config() *GlobalConfig

Config 安全的读取和修改配置

type HttpConfig

type HttpConfig struct {
	RouteBase  string   `json:"route_base"`
	Listen     string   `json:"listen"`
	CORS       []string `json:"cors"`
	TrustProxy []string `json:"trust_proxy"`
}

HttpConfig Http 配置

type IpLimitConfig

type IpLimitConfig struct {
	Enable  bool
	TrustIP []string `json:"trust_ip"`
}

type LoggerSection

type LoggerSection struct {
	Dir       string `json:"dir"`
	Level     string `json:"level"`
	KeepHours uint   `json:"keepHours"`
}

Jump to

Keyboard shortcuts

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