diff options
Diffstat (limited to 'connector/config.go')
-rw-r--r-- | connector/config.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/connector/config.go b/connector/config.go index 97e4556..0bf3614 100644 --- a/connector/config.go +++ b/connector/config.go @@ -46,6 +46,11 @@ func (c Configuration) GetBool(k string, deflt ...bool) (bool, error) { // ---- +type Protocol struct { + NewConnector func() Connector + Schema ConfigSchema +} + type ConfigSchema []*ConfigEntry type ConfigEntry struct { @@ -59,8 +64,8 @@ type ConfigEntry struct { IsBoolean bool } -var Protocols = map[string]ConfigSchema{} +var Protocols = map[string]Protocol{} -func Register(name string, schema ConfigSchema) { - Protocols[name] = schema +func Register(name string, protocol Protocol) { + Protocols[name] = protocol } |