Documentation
¶
Index ¶
- func LoadBootstrapConfig(bootstrapPath string, prefixes ...string) (*bootstrapv1.Bootstrap, error)
- func LoadConfig(bootstrapPath string, providerOpts *ProviderOptions) (*bootstrapv1.Bootstrap, runtimeconfig.KConfig, error)
- func SourceWithFile(path string) *sourcev1.SourceConfig
- type ConfigTransformFunc
- type ConfigTransformer
- type Option
- func WithConfig(cfg any) Option
- func WithConfigTarget(target any) Option
- func WithConfigTransformer(transformer ConfigTransformer) Option
- func WithDirectly(directly bool) Option
- func WithFrameworkOptions(opts ...options.Option) Option
- func WithPathResolver(fn func(string) string) Option
- func WithPrefixes(prefixes ...string) Option
- func WithProviderOptions(opts ...Option) Option
- func WithRawOptions(opts ...kratosconfig.Option) Option
- type PathResolverFunc
- type ProviderOptions
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadBootstrapConfig ¶
func LoadBootstrapConfig(bootstrapPath string, prefixes ...string) (*bootstrapv1.Bootstrap, error)
func LoadConfig ¶
func LoadConfig(bootstrapPath string, providerOpts *ProviderOptions) (*bootstrapv1.Bootstrap, runtimeconfig.KConfig, error)
LoadConfig creates a new configuration decoder instance.
func SourceWithFile ¶
func SourceWithFile(path string) *sourcev1.SourceConfig
Types ¶
type ConfigTransformFunc ¶
type ConfigTransformFunc func(runtimeconfig.KConfig) (any, error)
ConfigTransformFunc is a function type that implements the ConfigTransformer interface.
func (ConfigTransformFunc) Transform ¶
func (f ConfigTransformFunc) Transform(config runtimeconfig.KConfig) (any, error)
Transform implements the ConfigTransformer interface for ConfigTransformFunc.
type ConfigTransformer ¶
type ConfigTransformer interface {
Transform(runtimeconfig.KConfig) (any, error)
}
ConfigTransformer defines an interface for custom transformation of KConfig to a business configuration object.
type Option ¶
func WithConfig ¶
func WithConfigTarget ¶
func WithConfigTransformer ¶
func WithConfigTransformer(transformer ConfigTransformer) Option
func WithDirectly ¶
func WithFrameworkOptions ¶
func WithPathResolver ¶
func WithPrefixes ¶
func WithProviderOptions ¶
func WithRawOptions ¶
func WithRawOptions(opts ...kratosconfig.Option) Option
type PathResolverFunc ¶
PathResolverFunc defines the signature for a function that resolves a configuration path.
type ProviderOptions ¶
type ProviderOptions struct {
// contains filtered or unexported fields
}
func FromOptions ¶
func FromOptions(opts ...Option) *ProviderOptions
type Result ¶
type Result interface {
// Bootstrap [Source Phase] Returns the strong-typed bootstrap metadata (sources, service info, etc.)
Bootstrap() *bootstrapv1.Bootstrap
// Config [Binding Phase] Returns the final decoded business configuration (any type).
Config() any
// Decoder [Operations] Returns the enhanced configuration loader (follows Kratos design).
// It provides rich operations like Value(), Watch(), and Scan().
Decoder() config.KConfig
// ConfigPath returns the physical path of the loaded configuration file.
ConfigPath() string
}
Result defines the unified contract for the bootstrap engine output.
Click to show internal directories.
Click to hide internal directories.