File tree 1 file changed +15
-5
lines changed
1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
package configurator
2
2
3
+ var _ ConfigImplementer = (* ConfigType )(nil )
4
+
5
+ // ConfigType provides an abstract struct (née abstract base class) to compose
6
+ // into concrete config parser implementations.
3
7
type ConfigType struct {
4
- Data ConfigImplementer
8
+ // Config provides
9
+ Config ConfigImplementer
5
10
}
6
11
12
+ // Validate expects the implementor to return any errors found in the parsed
13
+ // configuration. If any errors are found it aims to provide clear user
14
+ // instruction as to where errors were encountered and how one would go about
15
+ // fixing it.
7
16
func (c * ConfigType ) Validate () error {
8
- // base case no validation required
9
- return nil
17
+ return c .Config .Validate ()
10
18
}
11
19
12
- func (c * ConfigType ) Merge (config any ) any {
13
- panic ("implement me" )
20
+ // Merge expects the implementor to merge the parsed configuration from the
21
+ // concrete implementation and bind it back into the provided domain config.
22
+ func (c * ConfigType ) Merge (domainConfig any ) any {
23
+ return c .Config .Merge (domainConfig )
14
24
}
You can’t perform that action at this time.
0 commit comments