Documentation
¶
Overview ¶
Package config implements the functions, types, and interfaces for the module.
Package config implements the functions, types, and interfaces for the module.
Package config implements the functions, types, and interfaces for the module.
Package config implements the functions, types, and interfaces for the module.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound defined error from kratos config package ErrNotFound = kratosconfig.ErrNotFound )
Functions ¶
This section is empty.
Types ¶
type BuildFunc ¶ added in v0.1.16
type BuildFunc func(*configv1.SourceConfig, ...SourceOptionSetting) (SourceConfig, error)
BuildFunc is a function type that takes a SourceConfig and a list of Options and returns a Selector and an error.
func (BuildFunc) NewConfig ¶ added in v0.1.16
func (fn BuildFunc) NewConfig(cfg *configv1.SourceConfig, ss ...SourceOptionSetting) (SourceConfig, error)
NewConfig is a method that implements the ConfigBuilder interface for ConfigBuildFunc.
type Builder ¶ added in v0.1.16
type Builder interface {
Factory
// RegisterConfigBuilder registers a config builder with the given name.
RegisterConfigBuilder(string, Factory)
}
Builder is an interface that defines a method for registering a config builder.
func NewBuilder ¶ added in v0.1.16
func NewBuilder() Builder
type Config ¶
type Config struct {
EnvPrefixes []string
// contains filtered or unexported fields
}
func (*Config) LoadFromFile ¶ added in v0.1.15
type Factory ¶ added in v0.1.16
type Factory interface {
// NewConfig creates a new config using the given SourceConfig and a list of Options.
NewConfig(*configv1.SourceConfig, ...SourceOptionSetting) (SourceConfig, error)
}
Factory is an interface that defines a method for creating a new config.
type Option ¶
type Option = kratosconfig.Option
Define types from kratos config package
func WithResolveActualTypes ¶
WithResolveActualTypes enables resolving actual types
type SourceConfig ¶ added in v0.1.15
type SourceConfig = kratosconfig.Config
Define types from kratos config package
type SourceOption ¶
type SourceOptionSetting ¶ added in v0.0.4
type SourceOptionSetting = func(s *SourceOption)
SourceOptionSetting is a function that takes a pointer to a SourceOption struct and modifies it.
func WithOptions ¶
func WithOptions(options ...Option) SourceOptionSetting
WithOptions sets the options field of the SourceOption struct.
type Syncer ¶ added in v0.1.16
type Syncer interface {
SyncConfig(*configv1.SourceConfig, any, ...SourceOptionSetting) error
}
Syncer is an interface that defines a method for synchronizing a config.