mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopd: export NewListenerConfig
This commit is contained in:
parent
139eac6feb
commit
618310fe6f
3 changed files with 10 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
10
loopd/run.go
10
loopd/run.go
|
|
@ -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…
Add table
Add a link
Reference in a new issue