config

package
v0.0.0-...-f0a7105 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 9 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 loader boot configuration

func LoadRemoteConfigSourceConfigs

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

LoadRemoteConfigSourceConfigs load local configuration from remote configuration source

func NewConfigProvider

func NewConfigProvider(configPath string) config.Config

NewConfigProvider create a configuration provider

func NewFileConfigSource

func NewFileConfigSource(filePath string) config.Source

NewFileConfigSource create a local file configuration source

func NewRemoteConfigSource

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

NewRemoteConfigSource create a remote configuration source

func RegisterConfig

func RegisterConfig(c interface{})

RegisterConfig register configuration

Types

type CommandFlags

type CommandFlags struct {
	Conf       string // Boot configuration file path, default is: ../../configs
	Env        string // Development environment: dev, debug...
	ConfigHost string // Remote configuration server address
	ConfigType string // Remote configuration server type
	Daemon     bool   // Whether to convert to daemon process
}

CommandFlags Command parameters

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

Jump to

Keyboard shortcuts

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