config

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 13 Imported by: 0

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 ServiceInfo

type ServiceInfo struct {
	Name     string
	Version  string
	Id       string
	Metadata map[string]string
}

func NewServiceInfo

func NewServiceInfo(name, version, id string) *ServiceInfo

func (*ServiceInfo) GetInstanceId

func (s *ServiceInfo) GetInstanceId() string

func (*ServiceInfo) SetMataData

func (s *ServiceInfo) SetMataData(k, v string)

func (*ServiceInfo) SetName

func (s *ServiceInfo) SetName(name string)

func (*ServiceInfo) SetVersion

func (s *ServiceInfo) SetVersion(version string)

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
apollo module
consul module
etcd module
kubernetes module
nacos module
polaris module

Jump to

Keyboard shortcuts

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