Merge pull request #432 from carlaKC/export-listnerconfig

loopd: export NewListenerConfig
pull/438/head
Carla Kirk-Cohen 2 years ago committed by GitHub
commit 04b4f0a389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,8 +34,8 @@ var (
errOnlyStartOnce = fmt.Errorf("daemon can only be started once")
)
// listenerCfg holds closures used to retrieve listeners for the gRPC services.
type listenerCfg struct {
// ListenerCfg holds closures used to retrieve listeners for the gRPC services.
type ListenerCfg struct {
// grpcListener returns a TLS listener to use for the gRPC server, based
// on the passed TLS configuration.
grpcListener func(*tls.Config) (net.Listener, error)
@ -66,7 +66,7 @@ type Daemon struct {
ErrChan chan error
cfg *Config
listenerCfg *listenerCfg
listenerCfg *ListenerCfg
internalErrChan chan error
lnd *lndclient.GrpcLndServices
@ -90,7 +90,7 @@ type Daemon struct {
}
// New creates a new instance of the loop client daemon.
func New(config *Config, lisCfg *listenerCfg) *Daemon {
func New(config *Config, lisCfg *ListenerCfg) *Daemon {
return &Daemon{
// We send exactly one error on this channel if something goes
// wrong at runtime. Or a nil value if the shutdown was

@ -48,10 +48,10 @@ type RPCConfig struct {
LndConn net.Conn
}
// newListenerCfg creates and returns a new listenerCfg from the passed config
// and RPCConfig.
func newListenerCfg(config *Config, rpcCfg RPCConfig) *listenerCfg {
return &listenerCfg{
// NewListenerConfig creates and returns a new listenerCfg from the passed
// config and RPCConfig.
func NewListenerConfig(config *Config, rpcCfg RPCConfig) *ListenerCfg {
return &ListenerCfg{
grpcListener: func(tlsCfg *tls.Config) (net.Listener, error) {
// If a custom RPC listener is set, we will listen on
// it instead of the regular tcp socket.
@ -218,7 +218,7 @@ func Run(rpcCfg RPCConfig) error {
// Print the version before executing either primary directive.
log.Infof("Version: %v", loop.Version())
lisCfg := newListenerCfg(&config, rpcCfg)
lisCfg := NewListenerConfig(&config, rpcCfg)
// Execute command.
if parser.Active == nil {

@ -11,7 +11,7 @@ import (
)
// view prints all swaps currently in the database.
func view(config *Config, lisCfg *listenerCfg) error {
func view(config *Config, lisCfg *ListenerCfg) error {
network := lndclient.Network(config.Network)
lnd, err := lisCfg.getLnd(network, config.Lnd)

Loading…
Cancel
Save