config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HomeDir string

Functions

This section is empty.

Types

type Config

type Config struct {
	Version  string           `json:"version" yaml:"version"`
	Log      *log.Config      `json:"log" yaml:"log"`
	Network  *api.Config      `json:"network" yaml:"network"`
	Database *database.Config `json:"database" yaml:"database"`
	// contains filtered or unexported fields
}

func GetDefault

func GetDefault() *Config

func New

func New(cfgPath ...string) (*Config, error)

func (*Config) ReplaceMagicVariables

func (c *Config) ReplaceMagicVariables(name, value string) (*Config, bool)

ReplaceMagicVariables 替换配置文件中的魔法变量。注意该方法只能调用一次再次调用则不会生效

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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