Configuration of a component inside a container.
Description
The ComponentConfig class allows you to configure a component residing inside a container.
Important points
- The configuration includes the type of information or descriptor and component configuration parameters.
Constructors
NewComponentConfigFromType
Creates a new instance of the configuration component.
NewComponentConfigFromType(typ *reflect.TypeDescriptor, config *config.ConfigParams) *config.ConfigParams
- typ: *reflect.TypeDescriptor - (optional) component’s type descriptor.
- config: *config.ConfigParams - (optional) component’s configuration parameters.
NewComponentConfigFromDescriptor
Creates a new instance of the configuration component.
NewComponentConfigFromDescriptor(descriptor *refer.Descriptor, config *config.ConfigParams) *ComponentConfig
- descriptor: *refer.Descriptor - (optional) component’s descriptor (locator).
- config: *config.ConfigParams - (optional) component’s configuration parameters.
Fields
Methods
ReadComponentConfigFromConfig
Creates a new instance of ComponentConfig based on a section from a container configuration. Throws ConfigError when neither component descriptor or type is found.
ReadComponentConfigFromConfig(config *config.ConfigParams) (result *ComponentConfig, err error)
- config: *config.ConfigParams - component’s parameters from a container configuration.
- returns: (result *ComponentConfig, err error) - created ComponentConfig or error.