config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config   *Configuration
	Version  = "v0.5.0"
	URL      = URLProd
	URLProd  = "https://anssl.cn/deploy"
	URLLocal = "http://localhost:9000/deploy"
)

Functions

func Init

func Init(configFile string) error

Init 初始化配置

Types

type Configuration

type Configuration struct {
	Server   *ServerConfig `yaml:"server"`
	SSL      *DeployConfig `yaml:"ssl"`
	Update   *UpdateConfig `yaml:"update"`
	Provider []*Provider   `yaml:"provider"`
}

Configuration 应用配置结构

func GetConfig

func GetConfig() *Configuration

GetConfig 获取配置

type DeployConfig added in v0.5.0

type DeployConfig struct {
	NginxPath  string `yaml:"nginxPath"`  // Nginx SSL 证书目录
	ApachePath string `yaml:"apachePath"` // Apache SSL 证书目录
	RustFSPath string `yaml:"rustFSPath"` // RustFS TLS 证书目录
}

type Provider

type Provider struct {
	Name   string        `yaml:"name"`
	Remark string        `yaml:"remark"`
	Auth   *ProviderAuth `yaml:"auth"`
}

func GetProvider

func GetProvider(name string) *Provider

GetProvider 获取提供商配置

func (*Provider) GetAccessKey added in v0.5.0

func (p *Provider) GetAccessKey() string

GetAccessKey 获取七牛云 AccessKey

func (*Provider) GetAccessKeyId added in v0.5.0

func (p *Provider) GetAccessKeyId() string

GetAccessKeyId 获取阿里云 AccessKeyId

func (*Provider) GetAccessKeySecret added in v0.5.0

func (p *Provider) GetAccessKeySecret() string

GetAccessKeySecret 获取阿里云 AccessKeySecret

func (*Provider) GetAccessSecret added in v0.5.0

func (p *Provider) GetAccessSecret() string

GetAccessSecret 获取七牛云 AccessSecret

func (*Provider) GetSecretId added in v0.5.0

func (p *Provider) GetSecretId() string

GetSecretId 获取腾讯云 SecretId

func (*Provider) GetSecretKey added in v0.5.0

func (p *Provider) GetSecretKey() string

GetSecretKey 获取腾讯云 SecretKey

type ProviderAuth added in v0.5.0

type ProviderAuth struct {
	// 阿里云认证字段
	AccessKeyId     string `yaml:"accessKeyId,omitempty"`
	AccessKeySecret string `yaml:"accessKeySecret,omitempty"`
	// 腾讯云认证字段
	SecretId  string `yaml:"secretId,omitempty"`
	SecretKey string `yaml:"secretKey,omitempty"`
	// 七牛云认证字段
	AccessKey    string `yaml:"accessKey,omitempty"`
	AccessSecret string `yaml:"accessSecret,omitempty"`
}

type ServerConfig

type ServerConfig struct {
	AccessKey string `yaml:"accessKey"`
	Env       string `yaml:"env"`
	Port      int    `yaml:"port"` // HTTP-01 challenge 服务端口,默认 19000
}

type UpdateConfig

type UpdateConfig struct {
	// 镜像源类型: github(默认), ghproxy, fastgit, custom
	Mirror string `yaml:"mirror"`
	// 自定义镜像地址(当 mirror=custom 时使用)
	CustomURL string `yaml:"customUrl"`
	// HTTP 代理地址
	Proxy string `yaml:"proxy"`
}

Jump to

Keyboard shortcuts

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