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.
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
- Variables
- type BuildFunc
- type Builder
- type Encoder
- type Factory
- type KConfig
- type KDecoder
- type KKeyValue
- type KMerge
- type KObserver
- type KOption
- type KReader
- type KResolver
- type KSource
- type KValue
- type KWatcher
- type Loader
- func (c *Loader) GetConfig() (*configv1.SourceConfig, error)
- func (c *Loader) GetResolved() (Resolved, error)
- func (c *Loader) GetResolver() (Resolver, error)
- func (c *Loader) GetSource() (KConfig, error)
- func (c *Loader) Load(cfg *configv1.SourceConfig, opts ...Option) error
- func (c *Loader) Resolve(config KConfig) error
- func (c *Loader) SetResolver(resolver Resolver) error
- type Option
- func AppendOptions(options ...KOption) Option
- func WithConfigName(name string) Option
- func WithDecoderOption(decoder KDecoder) Option
- func WithEncoderOption(encoder Encoder) Option
- func WithEnvPrefixes(prefixes ...string) Option
- func WithForceReload() Option
- func WithOptions(options ...KOption) Option
- func WithServiceName(name string) Option
- type Options
- type ProtoSyncer
- type ResolveFunc
- type ResolveObserver
- type Resolved
- type Resolver
- type SyncFunc
- type Syncer
Constants ¶
const Type = "config"
Variables ¶
var (
DefaultBuilder = NewBuilder()
)
var (
ErrInvalidConfigType = errors.New("invalid config type")
)
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, *Options) (KSource, error)
BuildFunc is a function type that takes a KConfig and a list of Options and returns a Selector and an error.
type Builder ¶ added in v0.1.16
type Builder interface {
factory.Registry[Factory]
NewConfig(*configv1.SourceConfig, ...Option) (KConfig, error)
}
Builder is an interface that defines a method for registering a config Builder.
func NewBuilder ¶ added in v0.1.16
func NewBuilder() Builder
type Factory ¶ added in v0.1.16
type Factory interface {
// NewSource creates a new config using the given KConfig and a list of Options.
NewSource(*configv1.SourceConfig, *Options) (KSource, error)
}
Factory is an interface that defines a method for creating a new config.
type KConfig ¶ added in v0.1.18
type KConfig = kratosconfig.Config
Define types from kratos config package
func NewSourceConfig ¶ added in v0.1.17
NewSourceConfig returns a new config instance
type KDecoder ¶ added in v0.1.18
type KDecoder = kratosconfig.Decoder
Define types from kratos config package
type KKeyValue ¶ added in v0.1.18
type KKeyValue = kratosconfig.KeyValue
Define types from kratos config package
type KMerge ¶ added in v0.1.18
type KMerge = kratosconfig.Merge
Define types from kratos config package
type KObserver ¶ added in v0.1.18
type KObserver = kratosconfig.Observer
Define types from kratos config package
type KOption ¶ added in v0.1.18
type KOption = kratosconfig.Option
Define types from kratos config package
func WithResolveActualTypes ¶
WithResolveActualTypes enables resolving actual types
type KReader ¶ added in v0.1.18
type KReader = kratosconfig.Reader
Define types from kratos config package
type KResolver ¶ added in v0.1.18
type KResolver = kratosconfig.Resolver
Define types from kratos config package
type KSource ¶ added in v0.1.18
type KSource = kratosconfig.Source
Define types from kratos config package
type KValue ¶ added in v0.1.18
type KValue = kratosconfig.Value
Define types from kratos config package
type KWatcher ¶ added in v0.1.18
type KWatcher = kratosconfig.Watcher
Define types from kratos config package
type Loader ¶ added in v0.2.0
type Loader struct {
// contains filtered or unexported fields
}
func NewWithBuilder ¶ added in v0.2.0
func (*Loader) GetConfig ¶ added in v0.2.1
func (c *Loader) GetConfig() (*configv1.SourceConfig, error)
func (*Loader) GetResolved ¶ added in v0.2.0
func (*Loader) GetResolver ¶ added in v0.2.0
func (*Loader) Load ¶ added in v0.2.0
func (c *Loader) Load(cfg *configv1.SourceConfig, opts ...Option) error
func (*Loader) SetResolver ¶ added in v0.2.0
type Option ¶
type Option = func(s *Options)
Option is a function that takes a pointer to a KOption struct and modifies it.
func AppendOptions ¶ added in v0.2.0
func WithConfigName ¶ added in v0.2.0
func WithDecoderOption ¶ added in v0.2.0
WithDecoderOption sets the decoder field of the KOption struct.
func WithEncoderOption ¶ added in v0.2.0
WithEncoderOption sets the encoder field of the KOption struct.
func WithEnvPrefixes ¶ added in v0.2.0
func WithForceReload ¶ added in v0.2.0
func WithForceReload() Option
func WithOptions ¶
WithOptions sets the options field of the KOption struct.
func WithServiceName ¶ added in v0.2.0
type ProtoSyncer ¶ added in v0.2.0
type ProtoSyncer interface {
SyncConfig(*configv1.SourceConfig, string, proto.Message, *Options) error
}
ProtoSyncer is an interface that defines a method for synchronizing a protobuf message.
type ResolveFunc ¶ added in v0.2.0
type ResolveObserver ¶ added in v0.2.0
type SyncFunc ¶ added in v0.2.1
func (SyncFunc) SyncConfig ¶ added in v0.2.1
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package customize implements the functions, types, and interfaces for the module.
|
Package customize implements the functions, types, and interfaces for the module. |
|
Package envsetup implements the functions, types, and interfaces for the module.
|
Package envsetup implements the functions, types, and interfaces for the module. |
|
Package file implements the functions, types, and interfaces for the module.
|
Package file implements the functions, types, and interfaces for the module. |
|
internal
|
|
|
reflection
Package reflection implements the functions, types, and interfaces for the module.
|
Package reflection implements the functions, types, and interfaces for the module. |