Documentation ¶
Index ¶
- func WrapAddressHandler(callback func(string, string, error), decoder *Decoder) func(*json.RawMessage)
- func WrapBlockHeadersHandler(callback func([]BlockHeader, error), decoder *Decoder) func(*json.RawMessage)
- func WrapNumBlocksHandler(callback func(int, error), decoder *Decoder) func(*json.RawMessage)
- func WrapPeersHandler(callback func([]Peer, error), decoder *Decoder) func(*json.RawMessage)
- type Action
- type AddressTransaction
- type Balance
- type BlockHeader
- type Client
- func (c *Client) AddressGetBalance(address string) (Balance, error)
- func (c *Client) AddressGetHistory(address string) ([]AddressTransaction, error)
- func (c *Client) AddressGetMemPool(address string) error
- func (c *Client) AddressListUnspent(address string) ([]UnspentTransaction, error)
- func (c *Client) AddressSubscribe(address string, callback func(string, string, error)) error
- func (c *Client) BlockHeaderSubscribe(callback func([]BlockHeader, error)) error
- func (c *Client) BroadcastTransaction(raw string) (string, error)
- func (c *Client) GetBlockChunk(chunk uint64) (string, error)
- func (c *Client) GetBlockHeader(height uint64) (BlockHeader, error)
- func (c *Client) Listen()
- func (c *Client) NumBlocksSubscribe(callback func(int, error)) error
- func (c *Client) PeersSubscribe(callback func([]Peer, error)) error
- func (c *Client) Request(method string, params ...string) *Response
- func (c *Client) Send(request *Request) *Response
- func (c *Client) ServerBanner() (string, error)
- func (c *Client) ServerDontationAddress() (string, error)
- func (c *Client) ServerVersion() (string, error)
- func (c *Client) SetTimeout(timeout int64)
- func (c *Client) Subscribe(method string, eventHandler func(*json.RawMessage), ...) error
- type Decoder
- func (d *Decoder) Decode(msg string, response *Response) error
- func (d *Decoder) DecodeAddressTransactions(response *json.RawMessage) ([]AddressTransaction, error)
- func (d *Decoder) DecodeAddressTransactionsResult(response *Response) ([]AddressTransaction, error)
- func (d *Decoder) DecodeBalance(response *Response) (Balance, error)
- func (d *Decoder) DecodeBlockHeader(response *Response) (BlockHeader, error)
- func (d *Decoder) DecodeBlockHeaders(response *json.RawMessage) ([]BlockHeader, error)
- func (d *Decoder) DecodeData(response *json.RawMessage, result interface{}) error
- func (d *Decoder) DecodeInt(response *json.RawMessage) (int, error)
- func (d *Decoder) DecodePeers(response *json.RawMessage) ([]Peer, error)
- func (d *Decoder) DecodeResult(response *Response, result interface{}) error
- func (d *Decoder) DecodeString(response *json.RawMessage) (string, error)
- func (d *Decoder) DecodeStringResult(response *Response) (string, error)
- func (d *Decoder) DecodeUnspent(response *Response) ([]UnspentTransaction, error)
- type Dispatcher
- type Encoder
- type Peer
- type Request
- type Response
- type Transaction
- type UnspentTransaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapAddressHandler ¶
func WrapBlockHeadersHandler ¶
func WrapBlockHeadersHandler(callback func([]BlockHeader, error), decoder *Decoder) func(*json.RawMessage)
func WrapNumBlocksHandler ¶
func WrapNumBlocksHandler(callback func(int, error), decoder *Decoder) func(*json.RawMessage)
func WrapPeersHandler ¶
func WrapPeersHandler(callback func([]Peer, error), decoder *Decoder) func(*json.RawMessage)
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
func MakeAction ¶
func MakeAction() *Action
func (*Action) SetTimeout ¶
type AddressTransaction ¶
type BlockHeader ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddressGetBalance ¶
func (*Client) AddressGetHistory ¶
func (c *Client) AddressGetHistory(address string) ([]AddressTransaction, error)
func (*Client) AddressGetMemPool ¶
func (*Client) AddressListUnspent ¶
func (c *Client) AddressListUnspent(address string) ([]UnspentTransaction, error)
func (*Client) AddressSubscribe ¶
func (*Client) BlockHeaderSubscribe ¶
func (c *Client) BlockHeaderSubscribe(callback func([]BlockHeader, error)) error
func (*Client) BroadcastTransaction ¶
func (*Client) GetBlockHeader ¶
func (c *Client) GetBlockHeader(height uint64) (BlockHeader, error)
func (*Client) NumBlocksSubscribe ¶
func (*Client) ServerBanner ¶
func (*Client) ServerDontationAddress ¶
func (*Client) ServerVersion ¶
func (*Client) SetTimeout ¶
func (*Client) Subscribe ¶
func (c *Client) Subscribe(method string, eventHandler func(*json.RawMessage), msgHandler func(*json.RawMessage), params ...string) error
type Decoder ¶
type Decoder struct{}
func MakeDecoder ¶
func MakeDecoder() *Decoder
func (*Decoder) DecodeAddressTransactions ¶
func (d *Decoder) DecodeAddressTransactions(response *json.RawMessage) ([]AddressTransaction, error)
func (*Decoder) DecodeAddressTransactionsResult ¶
func (d *Decoder) DecodeAddressTransactionsResult(response *Response) ([]AddressTransaction, error)
func (*Decoder) DecodeBalance ¶
func (*Decoder) DecodeBlockHeader ¶
func (d *Decoder) DecodeBlockHeader(response *Response) (BlockHeader, error)
func (*Decoder) DecodeBlockHeaders ¶
func (d *Decoder) DecodeBlockHeaders(response *json.RawMessage) ([]BlockHeader, error)
func (*Decoder) DecodeData ¶
func (d *Decoder) DecodeData(response *json.RawMessage, result interface{}) error
func (*Decoder) DecodePeers ¶
func (d *Decoder) DecodePeers(response *json.RawMessage) ([]Peer, error)
func (*Decoder) DecodeResult ¶
func (*Decoder) DecodeString ¶
func (d *Decoder) DecodeString(response *json.RawMessage) (string, error)
func (*Decoder) DecodeStringResult ¶
func (*Decoder) DecodeUnspent ¶
func (d *Decoder) DecodeUnspent(response *Response) ([]UnspentTransaction, error)
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func MakeDispatcher ¶
func MakeDispatcher() *Dispatcher
func (*Dispatcher) Cancel ¶
func (d *Dispatcher) Cancel(id uint64)
func (*Dispatcher) Error ¶
func (d *Dispatcher) Error(err error)
func (*Dispatcher) Process ¶
func (d *Dispatcher) Process(msg *Response)
func (*Dispatcher) RegisterNotifiactionHandler ¶
func (d *Dispatcher) RegisterNotifiactionHandler(uri string, callback func(*json.RawMessage))
func (*Dispatcher) RegisterRequest ¶
func (d *Dispatcher) RegisterRequest(request *Request) (*Action, error)
type Response ¶
type Response struct { ID uint64 `json:"id"` Result *json.RawMessage `json:"result"` Error error `json:"error,string"` Method string `json:"method"` Params *json.RawMessage `json:"params"` }
type Transaction ¶
type Transaction struct { }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.