Documentation
¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type AccuracyRoute
- type BasicAuth
- type Configuration
- type DefaultResponse
- type ForecastAccuracyRoute
- type ForecastRoute
- type ForecastTimeRoute
- type GenericSwaggerError
- type PriceChangeRoute
- type PriceCurrentRoute
- type PriceHistoryRoute
- type PrivateAccuracyResponse
- type PrivateAccuracyResponseData
- type PrivateApiService
- func (a *PrivateApiService) V1PrivateAccuracySymbolIntervalPeriodGet(ctx context.Context, symbol string, interval string, period string, ...) (PrivateAccuracyResponse, *http.Response, error)
- func (a *PrivateApiService) V1PrivateForecastAccuracySymbolIntervalPeriodGet(ctx context.Context, symbol string, interval string, period string, ...) (PrivateForecastAccuracyResponse, *http.Response, error)
- func (a *PrivateApiService) V1PrivateForecastSymbolIntervalGet(ctx context.Context, symbol string, interval string, ...) (PrivateForecastResponse, *http.Response, error)
- func (a *PrivateApiService) V1PrivateForecastTimeSymbolIntervalPeriodGet(ctx context.Context, symbol string, interval string, period string, ...) (PrivateForecastTimeResponse, *http.Response, error)
- func (a *PrivateApiService) V1PrivateTrendSymbolGet(ctx context.Context, symbol string, ...) (PublicTrendResponse, *http.Response, error)
- func (a *PrivateApiService) V1PrivateTrendTabularGet(ctx context.Context, localVarOptionals *PrivateApiV1PrivateTrendTabularGetOpts) (PrivateTrendTabularResponse, *http.Response, error)
- type PrivateApiV1PrivateAccuracySymbolIntervalPeriodGetOpts
- type PrivateApiV1PrivateForecastAccuracySymbolIntervalPeriodGetOpts
- type PrivateApiV1PrivateForecastSymbolIntervalGetOpts
- type PrivateApiV1PrivateForecastTimeSymbolIntervalPeriodGetOpts
- type PrivateApiV1PrivateTrendSymbolGetOpts
- type PrivateApiV1PrivateTrendTabularGetOpts
- type PrivateForecastAccuracyResponse
- type PrivateForecastAccuracyResponseData
- type PrivateForecastResponse
- type PrivateForecastResponseData
- type PrivateForecastResponseDataForecast
- type PrivateForecastTimeResponse
- type PrivateForecastTimeResponseData
- type PrivateTrendTabularResponse
- type PrivateTrendTabularResponseData
- type PrivateTrendTabularResponseDataTrendTabular
- type PublicApiService
- func (a *PublicApiService) V1PublicPriceChangeSymbolGet(ctx context.Context, symbol string) (PublicPriceChangeResponse, *http.Response, error)
- func (a *PublicApiService) V1PublicPriceCurrentSymbolGet(ctx context.Context, symbol string) (PublicPriceCurrentResponse, *http.Response, error)
- func (a *PublicApiService) V1PublicPriceHistorySymbolPeriodIntervalGet(ctx context.Context, symbol string, period string, interval string) (PublicPriceHistoryResponse, *http.Response, error)
- func (a *PublicApiService) V1PublicSummaryGet(ctx context.Context) (PublicSummaryResponse, *http.Response, error)
- func (a *PublicApiService) V1PublicSymbolsGet(ctx context.Context) (PublicSymbolsResponse, *http.Response, error)
- func (a *PublicApiService) V1PublicTrendSymbolGet(ctx context.Context, symbol string) (PublicTrendResponse, *http.Response, error)
- type PublicPriceChangeResponse
- type PublicPriceChangeResponseData
- type PublicPriceChangeResponseDataPriceChange
- type PublicPriceCurrentResponse
- type PublicPriceCurrentResponseData
- type PublicPriceCurrentResponseDataCurrent
- type PublicPriceHistoryResponse
- type PublicPriceHistoryResponseData
- type PublicPriceHistoryResponseDataHistory
- type PublicPriceHistoryResponseDataPriceHistory
- type PublicSummaryResponse
- type PublicSummaryResponseColor
- type PublicSummaryResponseData
- type PublicSymbolsResponse
- type PublicSymbolsResponseData
- type PublicSymbolsResponseDataSymbols
- type PublicTrendResponse
- type PublicTrendResponseData
- type PublicTrendResponseDataTrend
- type SummaryRoute
- type SymbolsRoute
- type TrendRoute
- type TrendTabluarRoute
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 {
PrivateApi *PrivateApiService
PublicApi *PublicApiService
// contains filtered or unexported fields
}
APIClient manages communication with the CryptoWeather API v 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 AccuracyRoute ¶
type AccuracyRoute struct {
}
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 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 DefaultResponse ¶
type ForecastAccuracyRoute ¶
type ForecastAccuracyRoute struct {
}
type ForecastRoute ¶
type ForecastRoute struct {
}
type ForecastTimeRoute ¶
type ForecastTimeRoute struct {
}
type GenericSwaggerError ¶
type GenericSwaggerError struct {
// contains filtered or unexported fields
}
GenericSwaggerError Provides access to the body, error and model on returned errors.
func (GenericSwaggerError) Body ¶
func (e GenericSwaggerError) Body() []byte
Body returns the raw bytes of the response
func (GenericSwaggerError) Error ¶
func (e GenericSwaggerError) Error() string
Error returns non-empty string if there was an error.
func (GenericSwaggerError) Model ¶
func (e GenericSwaggerError) Model() interface{}
Model returns the unpacked model of the error
type PriceChangeRoute ¶
type PriceChangeRoute struct {
}
type PriceCurrentRoute ¶
type PriceCurrentRoute struct {
}
type PriceHistoryRoute ¶
type PriceHistoryRoute struct {
}
type PrivateAccuracyResponse ¶
type PrivateAccuracyResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data *PrivateAccuracyResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PrivateApiService ¶
type PrivateApiService service
func (*PrivateApiService) V1PrivateAccuracySymbolIntervalPeriodGet ¶
func (a *PrivateApiService) V1PrivateAccuracySymbolIntervalPeriodGet(ctx context.Context, symbol string, interval string, period string, localVarOptionals *PrivateApiV1PrivateAccuracySymbolIntervalPeriodGetOpts) (PrivateAccuracyResponse, *http.Response, error)
func (*PrivateApiService) V1PrivateForecastAccuracySymbolIntervalPeriodGet ¶
func (a *PrivateApiService) V1PrivateForecastAccuracySymbolIntervalPeriodGet(ctx context.Context, symbol string, interval string, period string, localVarOptionals *PrivateApiV1PrivateForecastAccuracySymbolIntervalPeriodGetOpts) (PrivateForecastAccuracyResponse, *http.Response, error)
func (*PrivateApiService) V1PrivateForecastSymbolIntervalGet ¶
func (a *PrivateApiService) V1PrivateForecastSymbolIntervalGet(ctx context.Context, symbol string, interval string, localVarOptionals *PrivateApiV1PrivateForecastSymbolIntervalGetOpts) (PrivateForecastResponse, *http.Response, error)
func (*PrivateApiService) V1PrivateForecastTimeSymbolIntervalPeriodGet ¶
func (a *PrivateApiService) V1PrivateForecastTimeSymbolIntervalPeriodGet(ctx context.Context, symbol string, interval string, period string, localVarOptionals *PrivateApiV1PrivateForecastTimeSymbolIntervalPeriodGetOpts) (PrivateForecastTimeResponse, *http.Response, error)
func (*PrivateApiService) V1PrivateTrendSymbolGet ¶
func (a *PrivateApiService) V1PrivateTrendSymbolGet(ctx context.Context, symbol string, localVarOptionals *PrivateApiV1PrivateTrendSymbolGetOpts) (PublicTrendResponse, *http.Response, error)
func (*PrivateApiService) V1PrivateTrendTabularGet ¶
func (a *PrivateApiService) V1PrivateTrendTabularGet(ctx context.Context, localVarOptionals *PrivateApiV1PrivateTrendTabularGetOpts) (PrivateTrendTabularResponse, *http.Response, error)
type PrivateForecastAccuracyResponse ¶
type PrivateForecastAccuracyResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data *PrivateForecastAccuracyResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PrivateForecastAccuracyResponseData ¶
type PrivateForecastAccuracyResponseData struct {
Accuracy float32 `json:"accuracy"`
}
type PrivateForecastResponse ¶
type PrivateForecastResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data *PrivateForecastResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PrivateForecastResponseData ¶
type PrivateForecastResponseData struct {
Forecast []PrivateForecastResponseDataForecast `json:"forecast"`
}
type PrivateForecastResponseDataForecast ¶
type PrivateForecastResponseDataForecast struct {
TimeStart float32 `json:"time_start"`
TimeEnd float32 `json:"time_end"`
Low float32 `json:"low"`
WeightedPrice float32 `json:"weighted_price"`
High float32 `json:"high"`
Confidence float32 `json:"confidence"`
ChangeUsd float32 `json:"change_usd"`
ChangePct float32 `json:"change_pct"`
}
type PrivateForecastTimeResponse ¶
type PrivateForecastTimeResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data *PrivateForecastTimeResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PrivateForecastTimeResponseData ¶
type PrivateForecastTimeResponseData struct {
ForecastTime float32 `json:"forecast_time"`
}
type PrivateTrendTabularResponse ¶
type PrivateTrendTabularResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data *PrivateTrendTabularResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PrivateTrendTabularResponseData ¶
type PrivateTrendTabularResponseData struct {
TrendTabular []PrivateTrendTabularResponseDataTrendTabular `json:"trend_tabular"`
}
type PrivateTrendTabularResponseDataTrendTabular ¶
type PrivateTrendTabularResponseDataTrendTabular struct {
Symbol string `json:"symbol"`
Name string `json:"name"`
Trend []PublicTrendResponseDataTrend `json:"trend"`
}
type PublicApiService ¶
type PublicApiService service
func (*PublicApiService) V1PublicPriceChangeSymbolGet ¶
func (a *PublicApiService) V1PublicPriceChangeSymbolGet(ctx context.Context, symbol string) (PublicPriceChangeResponse, *http.Response, error)
PublicApiService Price Change
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param symbol The cryptocurrency symbol.
@return PublicPriceChangeResponse
func (*PublicApiService) V1PublicPriceCurrentSymbolGet ¶
func (a *PublicApiService) V1PublicPriceCurrentSymbolGet(ctx context.Context, symbol string) (PublicPriceCurrentResponse, *http.Response, error)
PublicApiService Price Current
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param symbol The cryptocurrency symbol, provide `all` to get every symbol.
@return PublicPriceCurrentResponse
func (*PublicApiService) V1PublicPriceHistorySymbolPeriodIntervalGet ¶
func (a *PublicApiService) V1PublicPriceHistorySymbolPeriodIntervalGet(ctx context.Context, symbol string, period string, interval string) (PublicPriceHistoryResponse, *http.Response, error)
PublicApiService Price History
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param symbol The cryptocurrency symbol, provide `all` to get every symbol.
- @param period The period to get data for, such as past 30 days.
- @param interval The bar interval, such as 1 day.
@return PublicPriceHistoryResponse
func (*PublicApiService) V1PublicSummaryGet ¶
func (a *PublicApiService) V1PublicSummaryGet(ctx context.Context) (PublicSummaryResponse, *http.Response, error)
PublicApiService Summary
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return PublicSummaryResponse
func (*PublicApiService) V1PublicSymbolsGet ¶
func (a *PublicApiService) V1PublicSymbolsGet(ctx context.Context) (PublicSymbolsResponse, *http.Response, error)
PublicApiService Symbols
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return PublicSymbolsResponse
func (*PublicApiService) V1PublicTrendSymbolGet ¶
func (a *PublicApiService) V1PublicTrendSymbolGet(ctx context.Context, symbol string) (PublicTrendResponse, *http.Response, error)
PublicApiService Trend The trend response contains a collection of forecasts for different intervals with the following attributes. + `time_start` start time of the period the forecast is applicable for + `time_end` end time of the period the forecast is applicable for + `interval` interval in hours that the forecast is applicable for + `weighted_price` forecasted weighted price during the period + `change_pct` percent change in price for forecasted weighted_price relative to current price + `change_usd` dollar change in price for forecasted weighted_price relative to current price
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param symbol The cryptocurrency symbol.
@return PublicTrendResponse
type PublicPriceChangeResponse ¶
type PublicPriceChangeResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data *PublicPriceChangeResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PublicPriceChangeResponseData ¶
type PublicPriceChangeResponseData struct {
PriceChange []PublicPriceChangeResponseDataPriceChange `json:"price_change"`
}
type PublicPriceCurrentResponse ¶
type PublicPriceCurrentResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data *PublicPriceCurrentResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PublicPriceCurrentResponseData ¶
type PublicPriceCurrentResponseData struct {
Current []PublicPriceCurrentResponseDataCurrent `json:"current"`
}
type PublicPriceHistoryResponse ¶
type PublicPriceHistoryResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data *PublicPriceHistoryResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PublicPriceHistoryResponseData ¶
type PublicPriceHistoryResponseData struct {
PriceHistory []PublicPriceHistoryResponseDataPriceHistory `json:"price_history"`
}
type PublicPriceHistoryResponseDataPriceHistory ¶
type PublicPriceHistoryResponseDataPriceHistory struct {
Symbol string `json:"symbol"`
Name string `json:"name"`
History []PublicPriceHistoryResponseDataHistory `json:"history"`
}
type PublicSummaryResponse ¶
type PublicSummaryResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data []PublicSummaryResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PublicSummaryResponseData ¶
type PublicSummaryResponseData struct {
Icon string `json:"icon"`
Name string `json:"name"`
SymbolName string `json:"symbol_name"`
Slug string `json:"slug"`
Added float32 `json:"added"`
Color *PublicSummaryResponseColor `json:"color"`
PriceBtc float32 `json:"price_btc"`
PriceUsd float32 `json:"price_usd"`
MarketCap float32 `json:"market_cap"`
VolumeUsd float32 `json:"volume_usd"`
ChangePct float32 `json:"change_pct"`
MarketDataTime float32 `json:"market_data_time"`
Trend []PublicTrendResponseDataTrend `json:"trend"`
}
type PublicSymbolsResponse ¶
type PublicSymbolsResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data *PublicSymbolsResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PublicSymbolsResponseData ¶
type PublicSymbolsResponseData struct {
Symbols []PublicSymbolsResponseDataSymbols `json:"symbols"`
}
type PublicTrendResponse ¶
type PublicTrendResponse struct {
Success bool `json:"success"`
Code int32 `json:"code"`
Status string `json:"status"`
Data *PublicTrendResponseData `json:"data"`
Errors []interface{} `json:"errors,omitempty"`
}
type PublicTrendResponseData ¶
type PublicTrendResponseData struct {
Trend []PublicTrendResponseDataTrend `json:"trend"`
}
type PublicTrendResponseDataTrend ¶
type PublicTrendResponseDataTrend struct {
TimeStart float32 `json:"time_start"`
TimeEnd float32 `json:"time_end"`
Interval string `json:"interval"`
WeightedPrice float32 `json:"weighted_price"`
ChangeUsd float32 `json:"change_usd"`
ChangePct float32 `json:"change_pct"`
Confidence float32 `json:"confidence"`
}
type SummaryRoute ¶
type SummaryRoute struct {
}
type SymbolsRoute ¶
type SymbolsRoute struct {
}
type TrendRoute ¶
type TrendRoute struct {
}
type TrendTabluarRoute ¶
type TrendTabluarRoute struct {
}
Source Files
¶
- api_private.go
- api_public.go
- client.go
- configuration.go
- model_accuracy_route.go
- model_default_response.go
- model_forecast_accuracy_route.go
- model_forecast_route.go
- model_forecast_time_route.go
- model_price_change_route.go
- model_price_current_route.go
- model_price_history_route.go
- model_private_accuracy_response.go
- model_private_accuracy_response_data.go
- model_private_forecast_accuracy_response.go
- model_private_forecast_accuracy_response_data.go
- model_private_forecast_response.go
- model_private_forecast_response_data.go
- model_private_forecast_response_data_forecast.go
- model_private_forecast_time_response.go
- model_private_forecast_time_response_data.go
- model_private_trend_tabular_response.go
- model_private_trend_tabular_response_data.go
- model_private_trend_tabular_response_data_trend_tabular.go
- model_public_price_change_response.go
- model_public_price_change_response_data.go
- model_public_price_change_response_data_price_change.go
- model_public_price_current_response.go
- model_public_price_current_response_data.go
- model_public_price_current_response_data_current.go
- model_public_price_history_response.go
- model_public_price_history_response_data.go
- model_public_price_history_response_data_history.go
- model_public_price_history_response_data_price_history.go
- model_public_summary_response.go
- model_public_summary_response_color.go
- model_public_summary_response_data.go
- model_public_symbols_response.go
- model_public_symbols_response_data.go
- model_public_symbols_response_data_symbols.go
- model_public_trend_response.go
- model_public_trend_response_data.go
- model_public_trend_response_data_trend.go
- model_summary_route.go
- model_symbols_route.go
- model_trend_route.go
- model_trend_tabluar_route.go
- response.go