Documentation ¶
Overview ¶
we store config seperately from terminus to prevent circular dependency errors
parse a config from a file. Note: this is meant for python parity only and may be deprecated at some point. Since we validate in our setters and not at runtime, we have to parse into an intermediary struct managed by goconf
Index ¶
- type Config
- func (c *Config) GetAccountPersistDir() string
- func (c *Config) GetAddress() string
- func (c *Config) GetBindHost() string
- func (c *Config) GetBindPort() int
- func (c *Config) GetCertChainFile() string
- func (c *Config) GetCertFile() string
- func (c *Config) GetExternalHost() string
- func (c *Config) GetExternalPort() int
- func (c *Config) GetHostName() string
- func (c *Config) GetKeyFile() string
- func (c *Config) GetRelayUrl() string
- func (c *Config) GetRpcAddress() string
- func (c *Config) GetRpcHostname() string
- func (c *Config) GetSelfSignedCert() bool
- func (c *Config) GetUseTls() bool
- func (c *Config) RpcServerTimeout() time.Duration
- func (c Config) Validate() error
- type ListenConfig
- type LndConfig
- func (l LndConfig) GRPCConnection(ctx context.Context) (conn *grpc.ClientConn, err error)
- func (l LndConfig) GetMacaroon() (mac *macaroon.Macaroon, err error)
- func (l LndConfig) GetTLSCert() (cert *tls.Config, err error)
- func (l LndConfig) LndHost() string
- func (l LndConfig) RPCClient(ctx context.Context) (rpcClient lnrpc.LightningClient, err error)
- func (l LndConfig) Validate() (err error)
- type RelayConfig
- type RpcConfig
- type Section
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // AccountPersistDir defines the directory to store accounts in AccountPersistDir string // ListenConfig defines the config to have generated beacons ListenConfig ListenConfig // RpcConfig defines the configuration for the rpc server to listen on RpcConfig RpcConfig // RelayConfig defines the configuration for the relay server (see: https://git.io/JmrYJ ) RelayConfig RelayConfig // LndConfig defines the configuration for hooking up with the lnd server LndConfig LndConfig }
Config for terminus/relayd
func ParseConfig ¶
ParseConfig parses a Config from the file contents returns an error if parsing fails. Validation can be done on the Config object
func ParseConfigFromFile ¶
ParseConfigFromFile is a wrapper around ParseConfig that also reads from the file returns an error if parsing fails. Validation can be done on the Config object
func (*Config) GetAccountPersistDir ¶
GetAccountPersistDir gets the account persist dir
func (*Config) GetAddress ¶
GetAddress fetches the address of the rpc server
func (*Config) GetBindHost ¶
GetBindHost gets the listening bind setting for allowing connections from other hosts
func (*Config) GetBindPort ¶
GetBindPort gets the port to listen for websocket connections
func (*Config) GetCertChainFile ¶
GetCertChainFile fetches the ssl certificate chain file
func (*Config) GetCertFile ¶
GetCertFile fetches the ssl certificate file
func (*Config) GetExternalHost ¶
GetExternalHost gets other devices to connect via the beacon
func (*Config) GetExternalPort ¶
GetExternalPort gets the externally binded port for other devices to connect via the beacon
func (*Config) GetKeyFile ¶
GetKeyFile gets the ssl certificate file
func (*Config) GetRpcAddress ¶
GetRpcAddress fetches the address (w/ connection schema) of the rpc server
func (*Config) GetRpcHostname ¶
GetRpcHostname fetches the hostname of the rpc server
func (*Config) GetSelfSignedCert ¶
GetSelfSignedCert fetches the ssl certificate file
func (*Config) RpcServerTimeout ¶
RpcServerTimeout fetches the server timeout
type ListenConfig ¶
type ListenConfig struct { // BindHost defines listening bind setting. Defaults to 127.0.0.1 for localhost connections, 0.0.0.0 // for allowing connections from other hosts BindHost string // BindPort defines the default port to listen for websocket connections port not specified. BindPort int // ExternalHost defines the host for other devices to connect via the beacon ExternalHost string // ExternalPort for other devices to connect via the beacon ExternalPort int // contains filtered or unexported fields }
ListenConfig specifies the configuration for terminus to listen on
type LndConfig ¶ added in v0.48.0
type LndConfig struct { // LndDir is the lnd settings directory LndDir string // MacaroonPath is the path to the macaroon to use for the lnd connection (requires invoice permissions) MacaroonPath string // TLSCertPath for LND, which is different from the websocket listening TLS TLSCertPath string // Network the lnd node is running on (e.g. mainnet, testnet, regtest) // TODO this can be handled with a getinfo command Network string // GrpcHost is the grpc host of the lnd node GrpcHost string //GrpcPort is the grpc port of the lnd node GrpcPort int }
LndConfig defines the lnd config (if lnd is in use)
func (LndConfig) GRPCConnection ¶ added in v0.48.0
GRPCConnection returns the grpc connection object
func (LndConfig) GetMacaroon ¶ added in v0.48.0
GetMacaroon fetches the encoded macaroon object from LndConfig
func (LndConfig) GetTLSCert ¶ added in v0.48.0
GetTLSCert fetches the tls cert from an LndConfig
type RelayConfig ¶ added in v0.42.0
type RelayConfig struct { // BindHost defines listening bind setting. Defaults to 127.0.0.1 for localhost connections, 0.0.0.0 // for allowing connections from other hosts BindHost string // BindPort defines the default port to listen for websocket connections port not specified. BindPort int // contains filtered or unexported fields }
RelayConfig defines the configuration for the relay
func (RelayConfig) Validate ¶ added in v0.42.0
func (r RelayConfig) Validate() error
Validate the configuration
type RpcConfig ¶
type RpcConfig struct { // BindHost for client to connect BindHost string // BindPort for client to connect BindPort int // ExternalHost for a client to connect ExternalHost string // ExternalPort for client to connect ExternalPort int }
RpcConfig defines the config for the rpc server
type Section ¶
type Section struct {
// contains filtered or unexported fields
}
Section defines a section of the config
func NewSection ¶
func NewSection(name string, cfg *goconfigparser.ConfigParser) Section
NewSection create a new section object that reads from a a section of the config
func (Section) GetBool ¶
GetBool gets an bool from the config section handles python None types (returning false)