Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct { // API Services DefaultApi *DefaultApiService QueryApi *QueryApiService StatApi *StatApiService // contains filtered or unexported fields }
APIClient manages communication with the Chain Query API v0.1.0 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type AddressSummary ¶
type AddressSummary struct { Address string `json:"Address,omitempty"` // Total amount received by address from all transactions it was a part of. TotalReceived float64 `json:"TotalReceived,omitempty"` // Total amount sent from address for all transactions it was a part of. TotalSent float64 `json:"TotalSent,omitempty"` // The current balance of an address Balance float64 `json:"Balance,omitempty"` }
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type ChainqueryStatus ¶ added in v1.2.3
type ChainqueryStatus struct { TableStatus []TableSize `json:"TableStatus,omitempty"` SemVersion string VersionShort string VersionLong string CommitMessage string }
Contains an array of tables and their row count.
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client }
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type DefaultApiService ¶ added in v0.1.0
type DefaultApiService service
func (*DefaultApiService) AutoUpdate ¶ added in v0.1.0
func (a *DefaultApiService) AutoUpdate(ctx context.Context, payload interface{}) (*http.Response, error)
DefaultApiService auto updates the application with the latest release based on TravisCI webhook
takes a webhook as defined by https://docs.travis-ci.com/user/notifications/#Webhooks-Delivery-Format, validates the public key, chooses whether or not update the application. If so it shuts down the api, downloads the latest release from https://github.com/lbryio/chainquery/releases, replaces the binary and starts the api again. * @param ctx context.Context for authentication, logging, tracing, etc. @param payload @return
type QueryApiService ¶
type QueryApiService service
func (*QueryApiService) SQLQuery ¶
func (a *QueryApiService) SQLQuery(ctx context.Context, query string, values []string) ([]interface{}, *http.Response, error)
QueryApiService Use SQL in a RESTful way
API exposed for sending SQL queries directly against the chainquery database. Since this is an exposed API there are limits to its use. These limits include queries per hour, read-only, limited to 60 second timeout. * @param ctx context.Context for authentication, logging, tracing, etc. @param query The SQL query to be put against the chainquery database. @param values when passing in a query use '?' for values which will be replaced in order of appearance with this array. @return []interface{}
type StatApiService ¶
type StatApiService service
func (*StatApiService) AddressSummary ¶
func (a *StatApiService) AddressSummary(ctx context.Context, lbryAddress string) (AddressSummary, *http.Response, error)
StatApiService Returns a summary of Address activity
It returns sent, recieved, balance, and number of transactions it has been used in. * @param ctx context.Context for authentication, logging, tracing, etc. @param lbryAddress A LbryAddress @return AddressSummary
func (*StatApiService) ChainQueryStatus ¶ added in v0.1.0
func (a *StatApiService) ChainQueryStatus(ctx context.Context) (ChainqueryStatus, *http.Response, error)
StatApiService Returns important status information about Chain Query * @param ctx context.Context for authentication, logging, tracing, etc. @return ChainqueryStatus