config

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File = fmt.Sprintf(
	"~%s%s%s%s",
	PathSeparator,
	configDir,
	PathSeparator,
	configName,
)

File 默认配置文件

View Source
var PathSeparator = string(os.PathSeparator)

PathSeparator path separator

Functions

func MigrationConfig

func MigrationConfig(conf *Config) error

MigrationConfig migration config version

func PathExists

func PathExists(path string) bool

PathExists path is has

func Up000201

func Up000201(conf *Config) error

Up000201 update version 0.2.1

func Up000702

func Up000702(conf *Config) error

Up000702 update version 0.7.2

func Up000706 added in v0.7.6

func Up000706(conf *Config) error

Up000706 update version 0.7.6

func Up000710 added in v0.7.10

func Up000710(conf *Config) error

Up000710 update version 0.7.10

Types

type Config

type Config struct {
	Version             string                   `toml:"version"`
	MountDir            string                   `toml:"mount_dir"`
	Image               string                   `toml:"image"`
	Timeout             time.Duration            `toml:"timeout"`
	DockerConfigDefault string                   `toml:"config_default"`
	DockerConfig        map[string]*DockerConfig `toml:"config"`
	ReadTimeout         time.Duration            `toml:"read_timeout"`
}

Config 配置

func InitConfig

func InitConfig() (*Config, error)

InitConfig init create file

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig load default file(not has init file)

func (*Config) Load

func (c *Config) Load() error

Load reload default file

func (*Config) Save

func (c *Config) Save() error

Save to default file

type DockerConfig

type DockerConfig struct {
	Version      string `toml:"version"`
	Host         string `toml:"host"`
	TLS          bool   `toml:"tls"`
	CertDir      string `toml:"cert_dir"`
	CertPassword string `toml:"cert_password"`
}

DockerConfig docker 配置

func (DockerConfig) String

func (c DockerConfig) String() string

Jump to

Keyboard shortcuts

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