config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, pattern string, def ...interface{}) (*gvar.Var, error)

func GetBool

func GetBool(ctx context.Context, pattern string, def ...interface{}) (bool, error)

func GetInt

func GetInt(ctx context.Context, pattern string, def ...interface{}) int

func GetMapStrStr

func GetMapStrStr(ctx context.Context, pattern string, def ...interface{}) map[string]string

func GetString

func GetString(ctx context.Context, pattern string, def ...interface{}) string

Types

type Api

type Api struct {
	Retry                   int   `json:"retry"`
	ModelKeyErrDisable      int64 `json:"model_key_err_disable"`
	ModelAgentErrDisable    int64 `json:"model_agent_err_disable"`
	ModelAgentKeyErrDisable int64 `json:"model_agent_key_err_disable"`
}

type Config

type Config struct {
	ApiServerAddress string      `json:"api_server_address"`
	Http             *Http       `json:"http"`
	Api              *Api        `json:"api"`
	Midjourney       *Midjourney `json:"midjourney"`
	Local            *Local      `json:"local"`
	Debug            bool        `json:"debug"`
}

配置信息

var Cfg *Config

type Http

type Http struct {
	Timeout  time.Duration `json:"timeout"`
	ProxyUrl string        `json:"proxy_url"`
}

type Local added in v0.2.0

type Local struct {
	PublicIp []string `json:"public_ip"`
}

type Midjourney

type Midjourney struct {
	CdnUrl          string           `json:"cdn_url"`
	MidjourneyProxy *MidjourneyProxy `json:"midjourney_proxy"`
}

type MidjourneyProxy

type MidjourneyProxy struct {
	ApiBaseUrl      string `json:"api_base_url"`
	ApiSecret       string `json:"api_secret"`
	ApiSecretHeader string `json:"api_secret_header"`
	CdnOriginalUrl  string `json:"cdn_original_url"`
}

Jump to

Keyboard shortcuts

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