config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 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 AccessToken

type AccessToken struct {
	BaseUrl  string `json:"base_url"`
	Path     string `json:"path"`
	ProxyUrl string `json:"proxy_url"`
}

type Aliyun

type Aliyun struct {
	Models map[string]*Model `json:"models"`
}

type App

type App struct {
	Id     string `json:"id"`
	Key    string `json:"key"`
	Secret string `json:"secret"`
}

type Baidu

type Baidu struct {
	AccessToken *AccessToken      `json:"access_token"`
	Models      map[string]*Model `json:"models"`
}

type Config

type Config struct {
	Sdk        *Sdk        `json:"sdk"`
	Filesystem *Filesystem `json:"filesystem"`
	Http       *Http       `json:"http"`
}

配置信息

var Cfg *Config

type CosSystem

type CosSystem struct {
	SecretId  string `json:"secret_id"`
	SecretKey string `json:"secret_key"`
	Bucket    string `json:"bucket"`
	Region    string `json:"region"`
}

腾讯云 COS 文件存储

type Filesystem

type Filesystem struct {
	Default string      `json:"default"`
	Local   LocalSystem `json:"local"`
	Oss     OssSystem   `json:"oss"`
	Qiniu   QiniuSystem `json:"qiniu"`
	Cos     CosSystem   `json:"cos"`
}

type Http

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

type LocalSystem

type LocalSystem struct {
	Root   string `json:"root"`
	Domain string `json:"domain"`
}

本地存储

type Midjourney

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

type MidjourneyProxy

type MidjourneyProxy struct {
	CdnProxyUrl     string `json:"cdn_proxy_url"`
	CdnOriginalUrl  string `json:"cdn_original_url"`
	ApiSecret       string `json:"api_secret"`
	ApiSecretHeader string `json:"api_secret_header"`
	ImagineUrl      string `json:"imagine_url"`
	SimpleChangeUrl string `json:"simple_change_url"`
	ChangeUrl       string `json:"change_url"`
	DescribeUrl     string `json:"describe_url"`
	BlendUrl        string `json:"blend_url"`
	FetchUrl        string `json:"fetch_url"`
}

type Model

type Model struct {
	BaseUrl   string   `json:"base_url"`
	Path      string   `json:"path"`
	ProxyUrl  string   `json:"proxy_url"`
	ApiKeys   []string `json:"api_keys"`
	Apps      []*App   `json:"apps"`
	MaxTokens int      `json:"max_tokens"`
	Domain    string   `json:"domain"` // 星火模型特有
}

type OpenAI

type OpenAI struct {
	Models map[string]*Model `json:"models"`
}

type OssSystem

type OssSystem struct {
	AccessID     string `json:"access_id"`
	AccessSecret string `json:"access_secret"`
	Bucket       string `json:"bucket"`
	Endpoint     string `json:"endpoint"`
}

阿里云 OSS 文件存储

type QiniuSystem

type QiniuSystem struct {
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
	Bucket    string `json:"bucket"`
	Domain    string `json:"domain"`
}

七牛云文件存储

type Sdk

type Sdk struct {
	OpenAI     *OpenAI     `json:"openai"`
	Baidu      *Baidu      `json:"baidu"`
	Xfyun      *Xfyun      `json:"xfyun"`
	Aliyun     *Aliyun     `json:"aliyun"`
	Midjourney *Midjourney `json:"midjourney"`
}

type Xfyun

type Xfyun struct {
	OriginalUrl string            `json:"original_url"`
	Models      map[string]*Model `json:"models"`
}

Jump to

Keyboard shortcuts

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