Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrIdentityNotFound is returned by GetIdentity. ErrIdentityNotFound = errors.New("identity not found") )
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
func UseClientLogger ¶
UseClientLogger uses a specified Logger to output client logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.
func UseServerLogger ¶
UseServerLogger uses a specified Logger to output client logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client encapsulates a connection to bmd and provides helper methods for retrieving relevant data.
func NewClient ¶
func NewClient(cfg *ClientConfig, msg, broadcast, getpubkey func(counter uint64, msg []byte)) (*Client, error)
NewClient creates a new RPC connection to bmd.
func (*Client) GetIdentity ¶
GetIdentity returns the public identity corresponding to the given address if it exists.
func (*Client) SendObject ¶
SendObject sends the given object to bmd so that it can send it out to the network.
func (*Client) Stop ¶
func (c *Client) Stop()
Stop disconnects the client and signals the shutdown of all goroutines started by Start.
func (*Client) WaitForShutdown ¶
func (c *Client) WaitForShutdown()
WaitForShutdown blocks until both the client has finished disconnecting and all handlers have exited.
type ClientConfig ¶
type ClientConfig struct { // DisableTLS specifies whether TLS should be disabled for a connection to // bmd. DisableTLS bool // CAFile is the file containing root certificates to authenticate a TLS // connection with bmd. CAFile string // ConnectTo is the hostname/IP and port of bmd RPC server to connect to. ConnectTo string // Username is the username to use for authentication with bmd. Username string // Password is the password to use for authentication with bmd. Password string // The timeout duration. Timeout time.Duration }
ClientConfig are configuration options for the RPC client to bmd.