config

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBootstrapConfig

func GetBootstrapConfig() *conf.Bootstrap

func LoadBootstrapConfig

func LoadBootstrapConfig(configPath string) error

LoadBootstrapConfig 加载程序引导配置

func LoadRemoteConfigSourceConfigs

func LoadRemoteConfigSourceConfigs(configPath string) (error, *conf.RemoteConfig)

LoadRemoteConfigSourceConfigs 加载远程配置源的本地配置

func NewConfigProvider

func NewConfigProvider(configPath string) config.Config

NewConfigProvider 创建一个配置

func NewFileConfigSource

func NewFileConfigSource(filePath string) config.Source

NewFileConfigSource 创建一个本地文件配置源

func NewRemoteConfigSource

func NewRemoteConfigSource(c *conf.RemoteConfig) config.Source

NewRemoteConfigSource 创建一个远程配置源

func RegisterConfig

func RegisterConfig(c interface{})

RegisterConfig 注册配置

Types

type CommandFlags

type CommandFlags struct {
	Conf       string // 引导配置文件路径,默认为:../../configs
	Env        string // 开发环境:dev、debug……
	ConfigHost string // 远程配置服务端地址
	ConfigType string // 远程配置服务端类型
	Daemon     bool   // 是否转为守护进程
}

CommandFlags 命令传参

func NewCommandFlags

func NewCommandFlags() *CommandFlags

func (*CommandFlags) Init

func (f *CommandFlags) Init()

type Type

type Type string
const (
	LocalFile  Type = "file"
	Nacos      Type = "nacos"
	Consul     Type = "consul"
	Etcd       Type = "etcd"
	Apollo     Type = "apollo"
	Kubernetes Type = "kubernetes"
	Polaris    Type = "polaris"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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