config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 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 {
	Core             Core       `json:"core"`
	ApiServerAddress string     `json:"api_server_address"`
	Http             Http       `json:"http"`
	Local            Local      `json:"local"`
	Api              Api        `json:"api"`
	Midjourney       Midjourney `json:"midjourney"`
	Gcp              Gcp        `json:"gcp"`
	RecordLogs       []string   `json:"record_logs"`
	Error            Error      `json:"error"`
	Debug            bool       `json:"debug"`
}

配置信息

var Cfg *Config

type Core added in v0.3.0

type Core struct {
	ChannelPrefix string `json:"channel_prefix"`
}

type Error added in v0.5.0

type Error struct {
	AutoDisabled []string `json:"auto_disabled"`
}

type Gcp added in v0.5.0

type Gcp struct {
	GetTokenUrl string `json:"get_token_url" d:"https://www.googleapis.com/oauth2/v4/token"`
}

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