config

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const File = ".goss.yml"

File The name of configuration file.

Variables

This section is empty.

Functions

func ReadInConfig

func ReadInConfig(path string) error

ReadInConfig Load the configuration file from the specified path.

func ReadInUserHomeConfig

func ReadInUserHomeConfig() error

ReadInUserHomeConfig Load the configuration file from user home directory.

func StructToEnv

func StructToEnv(driverType DriverType) error

func UserHomeConfigPath

func UserHomeConfigPath() (string, error)

UserHomeConfigPath Get the user home directory configuration path.

Types

type Aliyun

type Aliyun struct {
	Endpoint        string `yaml:"endpoint"`
	Bucket          string `yaml:"bucket"`
	AccessKeyID     string `yaml:"access_key_id"`
	AccessKeySecret string `yaml:"access_key_secret"`
}

type DriverType

type DriverType struct {
	Driver  string  `yaml:"driver"`
	Aliyun  Aliyun  `yaml:"aliyun"`
	Tencent Tencent `yaml:"tencent"`
	Qiniu   Qiniu   `yaml:"qiniu"`
	Huawei  Huawei  `yaml:"huawei"`
	S3      S3      `yaml:"s3"`
	Minio   Minio   `yaml:"minio"`
}

func LoadConfigFromEnv

func LoadConfigFromEnv() (DriverType, error)

type Huawei

type Huawei struct {
	Endpoint  string `yaml:"endpoint"`
	Location  string `yaml:"location"`
	Bucket    string `yaml:"bucket"`
	AccessKey string `yaml:"access_key"`
	SecretKey string `yaml:"secret_key"`
}

type Minio

type Minio struct {
	Endpoint  string `yaml:"endpoint"`
	Bucket    string `yaml:"bucket"`
	AccessKey string `yaml:"access_key"`
	SecretKey string `yaml:"secret_key"`
	UseSsl    bool   `yaml:"use_ssl"`
}

type Qiniu

type Qiniu struct {
	Bucket    string `yaml:"bucket"`
	AccessKey string `yaml:"access_key"`
	SecretKey string `yaml:"secret_key"`
	Zone      string `yaml:"zone"`
	Domain    string `yaml:"domain"`
	Private   string `yaml:"private"`
}

type S3

type S3 struct {
	Endpoint  string `yaml:"endpoint"`
	Region    string `yaml:"region"`
	Bucket    string `yaml:"bucket"`
	AccessKey string `yaml:"access_key"`
	SecretKey string `yaml:"secret_key"`
}

type Tencent

type Tencent struct {
	URL       string `yaml:"url"`
	SecretID  string `yaml:"secret_id"`
	SecretKey string `yaml:"secret_key"`
}

Jump to

Keyboard shortcuts

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