mirror of
https://github.com/mrusme/neonmodem.git
synced 2024-12-04 14:46:37 -05:00
Refactored adapter Capabilities
This commit is contained in:
parent
3e32a7715a
commit
8e785c5ada
@ -1,6 +1,21 @@
|
||||
package adapter
|
||||
|
||||
type Capabilities []Capability
|
||||
|
||||
type Capability struct {
|
||||
ID string
|
||||
Name string
|
||||
}
|
||||
|
||||
func (caps *Capabilities) IsCapableOf(capability string) bool {
|
||||
var can bool = false
|
||||
|
||||
for _, capb := range *caps {
|
||||
if capb.ID == capability {
|
||||
can = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return can
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ func (sys *System) SetLogger(logger *zap.SugaredLogger) {
|
||||
sys.logger = logger
|
||||
}
|
||||
|
||||
func (sys *System) GetCapabilities() []adapter.Capability {
|
||||
func (sys *System) GetCapabilities() adapter.Capabilities {
|
||||
var caps []adapter.Capability
|
||||
|
||||
return caps
|
||||
|
@ -46,7 +46,7 @@ func (sys *System) SetLogger(logger *zap.SugaredLogger) {
|
||||
sys.logger = logger
|
||||
}
|
||||
|
||||
func (sys *System) GetCapabilities() []adapter.Capability {
|
||||
func (sys *System) GetCapabilities() adapter.Capabilities {
|
||||
var caps []adapter.Capability
|
||||
|
||||
caps = append(caps,
|
||||
|
@ -44,7 +44,7 @@ func (sys *System) SetLogger(logger *zap.SugaredLogger) {
|
||||
sys.logger = logger
|
||||
}
|
||||
|
||||
func (sys *System) GetCapabilities() []adapter.Capability {
|
||||
func (sys *System) GetCapabilities() adapter.Capabilities {
|
||||
var caps []adapter.Capability
|
||||
|
||||
caps = append(caps,
|
||||
|
@ -45,7 +45,7 @@ func (sys *System) SetLogger(logger *zap.SugaredLogger) {
|
||||
sys.logger = logger
|
||||
}
|
||||
|
||||
func (sys *System) GetCapabilities() []adapter.Capability {
|
||||
func (sys *System) GetCapabilities() adapter.Capabilities {
|
||||
var caps []adapter.Capability
|
||||
|
||||
caps = append(caps,
|
||||
|
@ -19,7 +19,7 @@ type System interface {
|
||||
GetConfig() map[string]interface{}
|
||||
SetConfig(cfg *map[string]interface{})
|
||||
SetLogger(logger *zap.SugaredLogger)
|
||||
GetCapabilities() []adapter.Capability
|
||||
GetCapabilities() adapter.Capabilities
|
||||
|
||||
FilterValue() string
|
||||
Title() string
|
||||
|
Loading…
Reference in New Issue
Block a user