Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Auth(token string)
- func (c *Client) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, ...) (*http.Request, error)
- func (c *Client) NewRateRequest() *RateRequest
- func (c *Client) QueryRate(ctx context.Context, source string, target string) ([]Rate, error)
- func (c *Client) QueryRateHistory(ctx context.Context, source string, target string, from time.Time, ...) ([]Rate, error)
- type Group
- type Rate
- type RateRequest
- func (r *RateRequest) Do(ctx context.Context) ([]Rate, error)
- func (r *RateRequest) From(from time.Time) *RateRequest
- func (r *RateRequest) GetParameters() (map[string]interface{}, error)
- func (r *RateRequest) GetParametersJSON() ([]byte, error)
- func (r *RateRequest) GetParametersQuery() (url.Values, error)
- func (r *RateRequest) GetPath() string
- func (r *RateRequest) GetQueryParameters() (url.Values, error)
- func (r *RateRequest) GetSlugParameters() (map[string]interface{}, error)
- func (r *RateRequest) GetSlugsMap() (map[string]string, error)
- func (r *RateRequest) Group(group Group) *RateRequest
- func (r *RateRequest) Source(source string) *RateRequest
- func (r *RateRequest) Target(target string) *RateRequest
- func (r *RateRequest) Time(time time.Time) *RateRequest
- func (r *RateRequest) To(to time.Time) *RateRequest
- type Time
Constants ¶
View Source
const ( GroupMinute = Group("minute") GroupHour = Group("hour") GroupDay = Group("day") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { requestgen.BaseAPIClient // contains filtered or unexported fields }
func (*Client) NewAuthenticatedRequest ¶
func (*Client) NewRateRequest ¶
func (c *Client) NewRateRequest() *RateRequest
type Rate ¶
type Rate struct { Value fixedpoint.Value `json:"rate"` Target string `json:"target"` Source string `json:"source"` Time Time `json:"time"` }
type RateRequest ¶
type RateRequest struct {
// contains filtered or unexported fields
}
func (*RateRequest) Do ¶
func (r *RateRequest) Do(ctx context.Context) ([]Rate, error)
Do generates the request object and send the request object to the API endpoint
func (*RateRequest) From ¶
func (r *RateRequest) From(from time.Time) *RateRequest
func (*RateRequest) GetParameters ¶
func (r *RateRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*RateRequest) GetParametersJSON ¶
func (r *RateRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*RateRequest) GetParametersQuery ¶
func (r *RateRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*RateRequest) GetPath ¶
func (r *RateRequest) GetPath() string
GetPath returns the request path of the API
func (*RateRequest) GetQueryParameters ¶
func (r *RateRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*RateRequest) GetSlugParameters ¶
func (r *RateRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*RateRequest) GetSlugsMap ¶
func (r *RateRequest) GetSlugsMap() (map[string]string, error)
func (*RateRequest) Group ¶
func (r *RateRequest) Group(group Group) *RateRequest
func (*RateRequest) Source ¶
func (r *RateRequest) Source(source string) *RateRequest
func (*RateRequest) Target ¶
func (r *RateRequest) Target(target string) *RateRequest
func (*RateRequest) Time ¶
func (r *RateRequest) Time(time time.Time) *RateRequest
func (*RateRequest) To ¶
func (r *RateRequest) To(to time.Time) *RateRequest
Click to show internal directories.
Click to hide internal directories.