Documentation ¶
Index ¶
Constants ¶
const ( MethodGet = "get" MethodFileList = "file_list" MethodAccountList = "account_list" MethodStatus = "status" MethodResolve = "resolve" MethodClaimSearch = "claim_search" MethodPurchaseCreate = "purchase_create" ParamStreamingUrl = "streaming_url" ParamPurchaseReceipt = "purchase_receipt" )
Variables ¶
This section is empty.
Functions ¶
func MethodAcceptsWallet ¶
MethodAcceptsWallet returns true for methods that can accept wallet_id
func MethodRequiresWallet ¶
MethodRequiresWallet returns true for methods that require wallet_id
Types ¶
type Caller ¶
type Caller struct { // Preprocessor is applied to query before it's sent to the SDK. Preprocessor func(q *Query) // Cache stores cachable queries to improve performance Cache cache.QueryCache // contains filtered or unexported fields }
Caller patches through JSON-RPC requests from clients, doing pre/post-processing, account processing and validation.
func (*Caller) AddPreflightHook ¶ added in v0.14.1
AddPreflightHook adds query pre-flight hook function, allowing to amend the query before it gets sent to the JSON-RPC server, with an option to return an early response, avoiding sending the query to JSON-RPC server altogether
func (*Caller) Call ¶
func (c *Caller) Call(req *jsonrpc.RPCRequest) (*jsonrpc.RPCResponse, error)
Call method forwards a JSON-RPC request to the lbrynet server. It returns a response that is ready to be sent back to the JSON-RPC client as is.
type Query ¶
type Query struct { Request *jsonrpc.RPCRequest WalletID string }
Query is a wrapper around client JSON-RPC query for easier (un)marshaling and processing.
func NewQuery ¶
func NewQuery(req *jsonrpc.RPCRequest, walletID string) (*Query, error)
NewQuery initializes Query object with JSON-RPC request supplied as bytes. The object is immediately usable and returns an error in case request parsing fails. If wallet_id is not empty, it will be added as a param to the query when the Caller calls it.
func (*Query) ParamsAsMap ¶
ParamsAsMap returns query params converted to plain map.