An interface used to set configuration parameters to an object.
Implements: IConfigurable
See also IConfigurable
Description
The IReconfigurable interface is used to set configuration parameters to an object.
Important points:
- It is similar to IConfigurable interface, but emphasises the fact that the configure() method can be called more than once to change an object configuration in runtime.
Examples
type MyClass struct {
myParam string
}
func NewMyClass() *MyClass {
return &MyClass{
myParam: "default args",
},
}
// Implement configure
func (c * MyClass) Configure(config *cconf.ConfigParams) {
c.myParam = config.GetAsStringWithDefault("options.param", myParam);
...
}