From cd284d1214e9917a37eb4b0350d06f7d86ca3cd6 Mon Sep 17 00:00:00 2001 From: schulze Date: Wed, 3 May 2023 14:01:27 +0200 Subject: [PATCH] add basic command status (so program is able to run) --- pcsdk/commands.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pcsdk/commands.go b/pcsdk/commands.go index 34e5edb..f9f0103 100644 --- a/pcsdk/commands.go +++ b/pcsdk/commands.go @@ -41,6 +41,11 @@ func (p Proxy) Delete(id state.CustomUUID) error { return err } +func (p Proxy) Status() error { + _, err := p.execute(status()) + return err +} + // TODO: status function returning map of tunnels func (p Proxy) execute(c command) (string, error) { @@ -72,6 +77,7 @@ type command struct { Create *commandCreate `json:"create,omitempty"` Modify *commandModify `json:"modify,omitempty"` Delete *commandDelete `json:"delete,omitempty"` + Status *commandStatus `json:"status,omitempty"` Timestamp uint64 `json:"timestamp,omitempty"` Signature string `json:"signature,omitempty"` } @@ -112,4 +118,15 @@ func delete(id state.CustomUUID) command { c:= command{} c.Delete = &d return c -} \ No newline at end of file +} + + +type commandStatus struct { +} + +func status() command { + d:= commandStatus{} + c:= command{} + c.Status = &d + return c +}