Documentation ¶
Index ¶
- func ClientAddressDialer(defaultPort string) func(string, time.Duration) (net.Conn, error)
- func EnforceSafeAuthentication(addrs []net.Addr, macaroonsActive bool) error
- func IsLoopback(addr string) bool
- func IsUnix(addr net.Addr) bool
- func ListenOnAddress(addr net.Addr) (net.Listener, error)
- func NormalizeAddresses(addrs []string, defaultPort string, tcpResolver tcpResolver) ([]net.Addr, error)
- func ParseAddressString(strAddress string, defaultPort string, tcpResolver tcpResolver) (net.Addr, error)
- func ParseLNAddressString(strAddress string, defaultPort string, tcpResolver tcpResolver) (*lnwire.NetAddress, error)
- func TLSListenOnAddress(addr net.Addr, config *tls.Config) (net.Listener, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientAddressDialer ¶
ClientAddressDialer creates a gRPC dialer that can also dial unix socket addresses instead of just TCP addresses.
func EnforceSafeAuthentication ¶
EnforceSafeAuthentication enforces "safe" authentication taking into account the interfaces that the RPC servers are listening on, and if macaroons are activated or not. To protect users from using dangerous config combinations, we'll prevent disabling authentication if the server is listening on a public interface.
func IsLoopback ¶
IsLoopback returns true if an address describes a loopback interface.
func ListenOnAddress ¶
ListenOnAddress creates a listener that listens on the given address.
func NormalizeAddresses ¶
func NormalizeAddresses(addrs []string, defaultPort string, tcpResolver tcpResolver) ([]net.Addr, error)
NormalizeAddresses returns a new slice with all the passed addresses normalized with the given default port and all duplicates removed.
func ParseAddressString ¶
func ParseAddressString(strAddress string, defaultPort string, tcpResolver tcpResolver) (net.Addr, error)
ParseAddressString converts an address in string format to a net.Addr that is compatible with lnd. UDP is not supported because lnd needs reliable connections. We accept a custom function to resolve any TCP addresses so that caller is able control exactly how resolution is performed.
func ParseLNAddressString ¶
func ParseLNAddressString(strAddress string, defaultPort string, tcpResolver tcpResolver) (*lnwire.NetAddress, error)
ParseLNAddressString converts a string of the form <pubkey>@<addr> into an lnwire.NetAddress. The <pubkey> must be presented in hex, and result in a 33-byte, compressed public key that lies on the secp256k1 curve. The <addr> may be any address supported by ParseAddressString. If no port is specified, the defaultPort will be used. Any tcp addresses that need resolving will be resolved using the custom tcpResolver.
Types ¶
This section is empty.