Skip to content

Commit

Permalink
print plugin versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Oct 27, 2019
1 parent 99aca99 commit 9b2ce02
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cmd/shadows/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import (

func main() {
p := plugin.Plugin{
Name: "shadows",
Name: "shadows",
Version: "v0.1",
RPCMethods: []plugin.RPCMethod{
{
"shadow-invoice",
Expand Down
3 changes: 2 additions & 1 deletion cmd/sparko/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
3 changes: 2 additions & 1 deletion cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 5 additions & 4 deletions plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9b2ce02

Please sign in to comment.