From e696a38ec8111cc0cc070706321548747dbc2f51 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 15 May 2020 12:17:57 +0200 Subject: [PATCH] loopd: export Config struct --- loopd/config.go | 6 +++--- loopd/daemon.go | 2 +- loopd/start.go | 2 +- loopd/utils.go | 2 +- loopd/view.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/loopd/config.go b/loopd/config.go index 2e96eca..4c873e1 100644 --- a/loopd/config.go +++ b/loopd/config.go @@ -28,7 +28,7 @@ type lndConfig struct { type viewParameters struct{} -type config struct { +type Config struct { ShowVersion bool `short:"V" long:"version" description:"Display version information and exit"` Insecure bool `long:"insecure" description:"disable tls"` Network string `long:"network" description:"network to run on" choice:"regtest" choice:"testnet" choice:"mainnet" choice:"simnet"` @@ -60,8 +60,8 @@ const ( ) // DefaultConfig returns all default values for the Config struct. -func DefaultConfig() config { - return config{ +func DefaultConfig() Config { + return Config{ Network: "mainnet", RPCListen: "localhost:11010", RESTListen: "localhost:8081", diff --git a/loopd/daemon.go b/loopd/daemon.go index 919e27c..18323d5 100644 --- a/loopd/daemon.go +++ b/loopd/daemon.go @@ -40,7 +40,7 @@ type listenerCfg struct { // daemon runs loopd in daemon mode. It will listen for grpc connections, // execute commands and pass back swap status information. -func daemon(config *config, lisCfg *listenerCfg) error { +func daemon(config *Config, lisCfg *listenerCfg) error { lnd, err := lisCfg.getLnd(config.Network, config.Lnd) if err != nil { return err diff --git a/loopd/start.go b/loopd/start.go index a569ab2..e010139 100644 --- a/loopd/start.go +++ b/loopd/start.go @@ -47,7 +47,7 @@ type RPCConfig struct { // newListenerCfg creates and returns a new listenerCfg from the passed config // and RPCConfig. -func newListenerCfg(config *config, rpcCfg RPCConfig) *listenerCfg { +func newListenerCfg(config *Config, rpcCfg RPCConfig) *listenerCfg { return &listenerCfg{ grpcListener: func() (net.Listener, error) { // If a custom RPC listener is set, we will listen on diff --git a/loopd/utils.go b/loopd/utils.go index 0af6eab..0141693 100644 --- a/loopd/utils.go +++ b/loopd/utils.go @@ -10,7 +10,7 @@ import ( ) // getClient returns an instance of the swap client. -func getClient(config *config, lnd *lndclient.LndServices) (*loop.Client, +func getClient(config *Config, lnd *lndclient.LndServices) (*loop.Client, func(), error) { storeDir, err := getStoreDir(config.Network) diff --git a/loopd/view.go b/loopd/view.go index aa2d250..ff5084e 100644 --- a/loopd/view.go +++ b/loopd/view.go @@ -10,7 +10,7 @@ import ( ) // view prints all swaps currently in the database. -func view(config *config, lisCfg *listenerCfg) error { +func view(config *Config, lisCfg *listenerCfg) error { chainParams, err := swap.ChainParamsFromNetwork(config.Network) if err != nil { return err