Script hooks
This commit is contained in:
parent
ece3645237
commit
f1f0f499dd
2 changed files with 10 additions and 2 deletions
5
node.go
5
node.go
|
|
@ -38,6 +38,7 @@ type Node struct {
|
|||
Children []*Node
|
||||
|
||||
ConnectedNodes []Node
|
||||
ScriptHooks []Hook
|
||||
}
|
||||
|
||||
func GetNode(nodeID int) (node Node, err error) { // {{{
|
||||
|
|
@ -413,13 +414,13 @@ func UpdateConnection(connID int, data []byte) (err error) { // {{{
|
|||
}
|
||||
return
|
||||
} // }}}
|
||||
func DeleteConnection(connID int) (err error) {// {{{
|
||||
func DeleteConnection(connID int) (err error) { // {{{
|
||||
_, err = db.Exec(`DELETE FROM public.connection WHERE id=$1`, connID)
|
||||
if err != nil {
|
||||
err = werr.Wrap(err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}// }}}
|
||||
} // }}}
|
||||
|
||||
// vim: foldmethod=marker
|
||||
|
|
|
|||
|
|
@ -19,6 +19,13 @@ type Script struct {
|
|||
Updated time.Time
|
||||
}
|
||||
|
||||
type Hook struct {
|
||||
ID int
|
||||
Node Node
|
||||
Script Script
|
||||
SSH string
|
||||
}
|
||||
|
||||
func GetScripts() (scripts []Script, err error) {
|
||||
scripts = []Script{}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue