From 9b2ce02e540f308fc34b70b41da78f433b9cbf78 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 27 Oct 2019 22:47:06 +0000 Subject: [PATCH] print plugin versions. --- cmd/shadows/main.go | 3 ++- cmd/sparko/main.go | 3 ++- cmd/webhook/main.go | 3 ++- plugin/plugin.go | 9 +++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cmd/shadows/main.go b/cmd/shadows/main.go index 6497c36..9f683e9 100644 --- a/cmd/shadows/main.go +++ b/cmd/shadows/main.go @@ -19,7 +19,8 @@ import ( func main() { p := plugin.Plugin{ - Name: "shadows", + Name: "shadows", + Version: "v0.1", RPCMethods: []plugin.RPCMethod{ { "shadow-invoice", diff --git a/cmd/sparko/main.go b/cmd/sparko/main.go index d7fd468..d7da4d1 100644 --- a/cmd/sparko/main.go +++ b/cmd/sparko/main.go @@ -26,7 +26,8 @@ const DEFAULTPORT = "9737" func main() { p := plugin.Plugin{ - Name: "sparko", + Name: "sparko", + Version: "v1.3", Options: []plugin.Option{ {"sparko-host", "string", "127.0.0.1", "http(s) server listen address"}, {"sparko-port", "string", DEFAULTPORT, "http(s) server port"}, diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go index 50227bd..dcb779d 100644 --- a/cmd/webhook/main.go +++ b/cmd/webhook/main.go @@ -17,7 +17,8 @@ func main() { http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} p := plugin.Plugin{ - Name: "webhook", + Name: "webhook", + Version: "v3.0", Options: []plugin.Option{ { Name: "webhook", diff --git a/plugin/plugin.go b/plugin/plugin.go index 64e2501..00e9489 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -11,9 +11,10 @@ import ( ) type Plugin struct { - Client *lightning.Client `json:"-"` - Log func(...interface{}) ` json:"-"` - Name string `json:"-"` + Client *lightning.Client `json:"-"` + Log func(...interface{}) `json:"-"` + Name string `json:"-"` + Version string `json:"-"` Options []Option `json:"options"` RPCMethods []RPCMethod `json:"rpcmethods"` @@ -122,7 +123,7 @@ func (p *Plugin) Listener(initialized chan<- bool) { p.Client = &lightning.Client{Path: rpc} p.Args = Params(params["options"].(map[string]interface{})) - p.Log("initialized plugin.") + p.Log("initialized plugin " + p.Version) initialized <- true case "getmanifest": if p.Options == nil {