config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 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 {
	Http       *Http       `json:"http"`
	Api        *Api        `json:"api"`
	Midjourney *Midjourney `json:"midjourney"`
}

配置信息

var Cfg *Config

type Http

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

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