Added connection delete
This commit is contained in:
parent
03a3b409e2
commit
4fdc455bc7
1 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,8 @@ const (
|
||||||
ConnectionInterface = SettingsInterface + ".Connection"
|
ConnectionInterface = SettingsInterface + ".Connection"
|
||||||
|
|
||||||
ConnectionGetSettings = ConnectionInterface + ".GetSettings"
|
ConnectionGetSettings = ConnectionInterface + ".GetSettings"
|
||||||
|
|
||||||
|
ConnectionDelete = ConnectionInterface + ".Delete"
|
||||||
)
|
)
|
||||||
|
|
||||||
//type ConnectionSettings map[string]map[string]interface{}
|
//type ConnectionSettings map[string]map[string]interface{}
|
||||||
|
@ -24,6 +26,9 @@ type Connection interface {
|
||||||
// separately using the GetSecrets() call.
|
// separately using the GetSecrets() call.
|
||||||
GetSettings() ConnectionSettings
|
GetSettings() ConnectionSettings
|
||||||
|
|
||||||
|
// Delete will delete the connection
|
||||||
|
Delete()
|
||||||
|
|
||||||
MarshalJSON() ([]byte, error)
|
MarshalJSON() ([]byte, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +62,10 @@ func (c *connection) GetSettings() ConnectionSettings {
|
||||||
return rv
|
return rv
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *connection) Delete() {
|
||||||
|
c.call(c.GetPath(), ConnectionDelete)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *connection) MarshalJSON() ([]byte, error) {
|
func (c *connection) MarshalJSON() ([]byte, error) {
|
||||||
return json.Marshal(c.GetSettings())
|
return json.Marshal(c.GetSettings())
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue