Documentation ¶
Index ¶
- type Data
- type DataSlice
- func (s DataSlice) First() Data
- func (s DataSlice) FirstOptions() map[string]float64
- func (s DataSlice) FirstValue() float64
- func (s DataSlice) HasOptions() bool
- func (s DataSlice) IsEmpty() bool
- func (s DataSlice) Last() Data
- func (s DataSlice) LastOptions() map[string]float64
- func (s DataSlice) LastValue() float64
- type Format
- type Interval
- type Request
- func (r *Request) Do(ctx context.Context) (DataSlice, error)
- func (r *Request) GetParameters() (map[string]interface{}, error)
- func (r *Request) GetParametersJSON() ([]byte, error)
- func (r *Request) GetParametersQuery() (url.Values, error)
- func (r *Request) GetQueryParameters() (url.Values, error)
- func (r *Request) GetSlugParameters() (map[string]interface{}, error)
- func (r *Request) GetSlugsMap() (map[string]string, error)
- func (r *Request) SetAsset(Asset string) *Request
- func (r *Request) SetCategory(Category string) *Request
- func (r *Request) SetCurrency(Currency string) *Request
- func (r *Request) SetFormat(Format Format) *Request
- func (r *Request) SetInterval(Interval Interval) *Request
- func (r *Request) SetMetric(Metric string) *Request
- func (r *Request) SetSince(Since time.Time) *Request
- func (r *Request) SetTimestampFormat(TimestampFormat string) *Request
- func (r *Request) SetUntil(Until time.Time) *Request
- type RestClient
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSlice ¶ added in v1.36.0
type DataSlice []Data
In Glassnode API, there are two types of response, for example:
/v1/metrics/market/marketcap_usd [ { "t": 1614556800, "v": 927789865185.0476 }, ... ]
and
/v1/metrics/market/price_usd_ohlc [ { "t": 1614556800, "o": { "c": 49768.16035012147, "h": 49773.18922304233, "l": 45159.50305252744, "o": 45159.50305252744 } }, ... ]
both can be stored into the DataSlice structure.
Note: use `HasOptions` to verify the type of response.
func (DataSlice) FirstOptions ¶ added in v1.36.0
func (DataSlice) FirstValue ¶ added in v1.36.0
func (DataSlice) HasOptions ¶ added in v1.36.0
func (DataSlice) LastOptions ¶ added in v1.36.0
type Request ¶ added in v1.36.0
type Request struct { Client requestgen.AuthenticatedAPIClient Asset string `param:"a,required,query"` Since *time.Time `param:"s,query,seconds"` Until *time.Time `param:"u,query,seconds"` Interval *Interval `param:"i,query"` Format *Format `param:"f,query" default:"JSON"` Currency *string `param:"c,query"` TimestampFormat *string `param:"timestamp_format,query"` Category string `param:"category,slug"` Metric string `param:"metric,slug"` }
func (*Request) GetParameters ¶ added in v1.36.0
GetParameters builds and checks the parameters and return the result in a map object
func (*Request) GetParametersJSON ¶ added in v1.36.0
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*Request) GetParametersQuery ¶ added in v1.36.0
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*Request) GetQueryParameters ¶ added in v1.36.0
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*Request) GetSlugParameters ¶ added in v1.36.0
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*Request) GetSlugsMap ¶ added in v1.36.0
func (*Request) SetCategory ¶ added in v1.36.0
func (*Request) SetCurrency ¶ added in v1.36.0
func (*Request) SetInterval ¶ added in v1.36.0
func (*Request) SetTimestampFormat ¶ added in v1.36.0
type RestClient ¶
type RestClient struct { requestgen.BaseAPIClient // contains filtered or unexported fields }
func NewRestClient ¶
func NewRestClient() *RestClient
func (*RestClient) Auth ¶
func (c *RestClient) Auth(apiKey string)
Click to show internal directories.
Click to hide internal directories.