Script hooks

This commit is contained in:
Magnus Åhall 2025-08-07 14:04:08 +02:00
parent ece3645237
commit f1f0f499dd
2 changed files with 10 additions and 2 deletions

View file

@ -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

View file

@ -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{}