conf

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppName = "auth-api"
View Source
var AppVersion = "0.1.0"
View Source
var BuildTime = "unknown"
View Source
var GitSHA1 = "unknown"

Functions

func WithGlobalCtx added in v0.4.0

func WithGlobalCtx(ctx context.Context) context.Context

Types

type AuthURL added in v0.3.0

type AuthURL struct {
	DefaultHost string   `json:"default_host" toml:"default_host"`
	DefaultPath string   `json:"default_path" toml:"default_path"`
	AllowHosts  []string `json:"allow_hosts" toml:"allow_hosts"`
	DefaultURL  url.URL
}

func (*AuthURL) CheckNextUrl added in v0.3.0

func (c *AuthURL) CheckNextUrl(nextUrl string) (url.URL, bool)

func (*AuthURL) GenNextUrl added in v0.3.0

func (c *AuthURL) GenNextUrl(u *url.URL, status int, xRequestId string) string

type Base added in v0.6.0

type Base struct {
	Userbase   string `json:"userbase" toml:"userbase"`
	Logbase    string `json:"logbase" toml:"logbase"`
	Walletbase string `json:"walletbase" toml:"walletbase"`
}

type ConfigTpl

type ConfigTpl struct {
	Rand           *rand.Rand
	GlobalSignal   context.Context
	GlobalShutdown context.Context
	Env            string              `json:"env" toml:"env"`
	Home           string              `json:"home" toml:"home"`
	Logger         Logger              `json:"log" toml:"log"`
	Server         Server              `json:"server" toml:"server"`
	Cookie         Cookie              `json:"cookie" toml:"cookie"`
	AuthURL        AuthURL             `json:"auth_url" toml:"auth_url"`
	Base           Base                `json:"base" toml:"base"`
	Keys           Keys                `json:"keys" toml:"keys"`
	Providers      map[string]Provider `json:"providers" toml:"providers"`
	OSS            OSS                 `json:"oss" toml:"oss"`
	COSEKeys       struct {
		CWTPub      key.Key
		Oauth2State key.Key
	}
	// contains filtered or unexported fields
}

ConfigTpl ...

var Config ConfigTpl

Config ...

func (*ConfigTpl) JobsIdle added in v0.4.0

func (c *ConfigTpl) JobsIdle() bool

func (*ConfigTpl) ObtainJob added in v0.4.0

func (c *ConfigTpl) ObtainJob()

func (*ConfigTpl) ReleaseJob added in v0.4.0

func (c *ConfigTpl) ReleaseJob()

func (*ConfigTpl) Validate

func (c *ConfigTpl) Validate() error
type Cookie struct {
	NamePrefix   string `json:"name_prefix" toml:"name_prefix"`
	Domain       string `json:"domain" toml:"domain"`
	Secure       bool   `json:"secure" toml:"secure"`
	ExpiresIn    uint   `json:"expires_in" toml:"expires_in"`
	WeChatDomain string `json:"wechat_domain" toml:"wechat_domain"`
}

type Keys

type Keys struct {
	CWTPub      string `json:"cwt_pub" toml:"cwt_pub"`
	Oauth2State string `json:"oauth2_state" toml:"oauth2_state"`
}

type Logger

type Logger struct {
	Level string `json:"level" toml:"level"`
}

type OSS added in v0.2.0

type OSS struct {
	Bucket          string `json:"bucket" toml:"bucket"`
	Endpoint        string `json:"endpoint" toml:"endpoint"`
	AccessKeyId     string `json:"access_key_id" toml:"access_key_id"`
	AccessKeySecret string `json:"access_key_secret" toml:"access_key_secret"`
	Prefix          string `json:"prefix" toml:"prefix"`
	UrlBase         string `json:"url_base" toml:"url_base"`
}

type Provider

type Provider struct {
	ClientID     string   `json:"client_id" toml:"client_id"`
	ClientSecret string   `json:"client_secret" toml:"client_secret"`
	RedirectURL  string   `json:"redirect_uri" toml:"redirect_uri"`
	Scopes       []string `json:"scopes" toml:"scopes"`
}

type Server

type Server struct {
	Addr             string `json:"addr" toml:"addr"`
	GracefulShutdown uint   `json:"graceful_shutdown" toml:"graceful_shutdown"`
}

Jump to

Keyboard shortcuts

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