Documentation ¶
Index ¶
- func CheckResponse(r *http.Response) error
- func ReadAndAssignResponseBody(res *http.Response) (io.Reader, error)
- type Client
- type ClientOpt
- type CodeRepository
- type CodeRepositoryItem
- type Coin
- type CoinNamesSorter
- type CoinService
- type CoinServiceOp
- type CryptoCompare
- type CryptopianFollower
- type ErrorResponse
- type Facebook
- type General
- type Histoday
- type HistodayRequest
- type HistodayService
- type HistodayServiceOp
- type Histominute
- type HistominuteRequest
- type HistominuteResponse
- type HistominuteService
- type HistominuteServiceOp
- type PageViewsSplit
- type Price
- type PriceFull
- type PriceMulti
- type PriceMultiFull
- type PriceMultiFullAgg
- type PriceMultiFullService
- type PriceMultiFullServiceOp
- type PriceMultiNameSorter
- type PriceMultiRequest
- type PriceMultiService
- type PriceMultiServiceOp
- type PriceNameSorter
- type PriceRequest
- type PriceService
- type PriceServiceOp
- type Reddit
- type RequestCompletionCallback
- type Response
- type SimilarItem
- type SocialStats
- type SocialStatsService
- type SocialStatsServiceOp
- type Source
- type Twitter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
Types ¶
type Client ¶
type Client struct { BaseURL *url.URL MinURL *url.URL UserAgent string Coin CoinService Price PriceService PriceMulti PriceMultiService PriceMultiFull PriceMultiFullService SocialStats SocialStatsService Histoday HistodayService Histomin HistominuteService // contains filtered or unexported fields }
func (*Client) NewRequest ¶
func (*Client) OnRequestCompleted ¶
func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)
type CodeRepository ¶
type CodeRepository struct { List []CodeRepositoryItem `json:"List"` Points int `json:"Points"` }
type CodeRepositoryItem ¶
type CodeRepositoryItem struct { Stars int `json:"stars"` Language string `json:"language"` Forks int `json:"forks"` OpenTotalIssues string `json:"open_total_issues"` Subscribers int `json:"subscribers"` Size string `json:"size"` Url string `json:"url"` LastUpdate string `json:"last_update"` LastPush string `json:"last_push"` CreatedAt string `json:"created_at"` Fork bool `json:"fork,string"` Source Source `json:"source"` Parent Source `json:"parent"` OpenPullIssues string `json:"open_pull_issues"` ClosedPullIssues string `json:"closed_pull_issues"` ClosedTotalIssues string `json:"closed_total_issues"` OpenIssues string `json:"open_issues"` ClosedIssues string `json:"closed_issues"` }
type Coin ¶
type Coin struct { Id string `json:"Id"` Url string `json:"Url"` ImageUrl string `json:"ImageUrl"` Name string `json:"Name"` CoinName string `json:"CoinName"` FullName string `json:"FullName"` Algorithm string `json:"Algorithm"` ProofType string `json:"ProofType"` SortOrder string `json:"SortOrder"` }
type CoinNamesSorter ¶
type CoinNamesSorter []Coin
TODO try to remove Sorter duplication
func (CoinNamesSorter) Len ¶
func (a CoinNamesSorter) Len() int
func (CoinNamesSorter) Less ¶
func (a CoinNamesSorter) Less(i, j int) bool
func (CoinNamesSorter) Swap ¶
func (a CoinNamesSorter) Swap(i, j int)
type CoinServiceOp ¶
type CoinServiceOp struct {
// contains filtered or unexported fields
}
type CryptoCompare ¶
type CryptoCompare struct { SimilarItems []SimilarItem `json:"SimilarItems"` CryptopianFollowers []CryptopianFollower `json:"CryptopianFollowers"` Comments string `json:"Comments"` Points int `json:"Points"` Posts string `json:"Posts"` Followers int `json:"Followers"` PageViewsSplit PageViewsSplit `json:"PageViewsSplit"` PageViews int `json:"PageViews"` }
type CryptopianFollower ¶
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response Message string `json:"message"` RequestID string `json:"request_id"` }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type HistodayRequest ¶
type HistodayRequest struct { Fsym string Tsym string E string ExtraParams string Sign bool TryConversion bool Aggregate int // Not Used For Now Limit int ToTs time.Time // Not Used For Now AllData bool }
func NewHistodayRequest ¶
func NewHistodayRequest(fsym string, tsym string, limitDays int, allData bool) *HistodayRequest
func (*HistodayRequest) FormattedQueryString ¶
func (hr *HistodayRequest) FormattedQueryString(baseUrl string) string
type HistodayService ¶
type HistodayService interface {
Get(context.Context, *HistodayRequest) ([]Histoday, *Response, error)
}
Get the history kline data of any cryptocurrency in any other currency that you need.
type HistodayServiceOp ¶
type HistodayServiceOp struct {
// contains filtered or unexported fields
}
func (*HistodayServiceOp) Get ¶
func (s *HistodayServiceOp) Get(ctx context.Context, histodayRequest *HistodayRequest) ([]Histoday, *Response, error)
type Histominute ¶
type HistominuteRequest ¶
type HistominuteRequest struct { Fsym string Tsym string E string ExtraParams string Sign bool TryConversion bool Aggregate int // Not Used For Now Limit int ToTs int64 }
func NewHistominuteRequest ¶
func NewHistominuteRequest(fsym string, tsym string, limitMinutes int, fromTime int64) *HistominuteRequest
func (*HistominuteRequest) FormattedQueryString ¶
func (hr *HistominuteRequest) FormattedQueryString(baseUrl string) string
type HistominuteResponse ¶
type HistominuteResponse struct { Response string `json:"Response"` Message string `json:"Message"` // Error Message Type int `json:"Type"` Aggregated bool `json:"Aggregated"` Data []Histominute `json:"Data"` TimeTo int64 `json:"TimeTo"` TimeFrom int64 `json:"TimeFrom"` FirstValueInArray bool `json:"FirstValueInArray"` ConversionType conversionType `json:"ConversionType"` }
type HistominuteService ¶
type HistominuteService interface {
Get(context.Context, *HistominuteRequest) (*HistominuteResponse, *Response, error)
}
Get the history kline data of any cryptocurrency in any other currency that you need.
type HistominuteServiceOp ¶
type HistominuteServiceOp struct {
// contains filtered or unexported fields
}
func (*HistominuteServiceOp) Get ¶
func (s *HistominuteServiceOp) Get(ctx context.Context, histominuteRequest *HistominuteRequest) (*HistominuteResponse, *Response, error)
type PageViewsSplit ¶
type PriceMulti ¶
type PriceMultiFull ¶
type PriceMultiFull struct { Raw map[string]map[string]PriceMultiFullAgg `json:"RAW"` Display map[string]map[string]PriceMultiFullAgg `json:"DISPLAY"` }
type PriceMultiFullAgg ¶
type PriceMultiFullService ¶
type PriceMultiFullService interface {
List(context.Context, *PriceMultiRequest) ([]PriceMultiFull, *Response, error)
}
Get all the current trading info (price, vol, open, high, low etc) of any list of cryptocurrencies in any other currency that you need. If the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. This API also returns Display values for all the fields.If the oposite pair trades we invert it (eg.: BTC-XMR)".
type PriceMultiFullServiceOp ¶
type PriceMultiFullServiceOp struct {
// contains filtered or unexported fields
}
func (*PriceMultiFullServiceOp) List ¶
func (s *PriceMultiFullServiceOp) List(ctx context.Context, priceMultiRequest *PriceMultiRequest) ([]PriceMultiFull, *Response, error)
type PriceMultiNameSorter ¶
type PriceMultiNameSorter []PriceMulti
TODO try to remove Sorter duplication
func (PriceMultiNameSorter) Len ¶
func (a PriceMultiNameSorter) Len() int
func (PriceMultiNameSorter) Less ¶
func (a PriceMultiNameSorter) Less(i, j int) bool
func (PriceMultiNameSorter) Swap ¶
func (a PriceMultiNameSorter) Swap(i, j int)
type PriceMultiRequest ¶
type PriceMultiRequest struct { Fsyms []string Tsyms []string E string ExtraParams string Sign bool TryConversion bool }
func NewPriceMultiFullRequest ¶
func NewPriceMultiFullRequest(fsyms []string, tsyms []string) *PriceMultiRequest
func NewPriceMultiRequest ¶
func NewPriceMultiRequest(fsyms []string, tsyms []string) *PriceMultiRequest
func (*PriceMultiRequest) FormattedQueryString ¶
func (pr *PriceMultiRequest) FormattedQueryString(baseUrl string) string
type PriceMultiService ¶
type PriceMultiService interface {
List(context.Context, *PriceMultiRequest) ([]PriceMulti, *Response, error)
}
Same as single API path but with multiple from symbols.
type PriceMultiServiceOp ¶
type PriceMultiServiceOp struct {
// contains filtered or unexported fields
}
func (*PriceMultiServiceOp) List ¶
func (s *PriceMultiServiceOp) List(ctx context.Context, priceMultiRequest *PriceMultiRequest) ([]PriceMulti, *Response, error)
type PriceNameSorter ¶
type PriceNameSorter []Price
TODO try to remove Sorter duplication
func (PriceNameSorter) Len ¶
func (a PriceNameSorter) Len() int
func (PriceNameSorter) Less ¶
func (a PriceNameSorter) Less(i, j int) bool
func (PriceNameSorter) Swap ¶
func (a PriceNameSorter) Swap(i, j int)
type PriceRequest ¶
type PriceRequest struct { Fsym string Tsyms []string E string ExtraParams string Sign bool TryConversion bool }
func NewPriceRequest ¶
func NewPriceRequest(fsym string, tsyms []string) *PriceRequest
func (*PriceRequest) FormattedQueryString ¶
func (pr *PriceRequest) FormattedQueryString(baseUrl string) string
type PriceService ¶
Get the current price of any cryptocurrency in any other currency that you need. If the crypto does not trade directly into the toSymbol requested, BTC will be used for conversion. If the oposite pair trades we invert it (eg.: BTC-XMR).
type PriceServiceOp ¶
type PriceServiceOp struct {
// contains filtered or unexported fields
}
func (*PriceServiceOp) List ¶
func (s *PriceServiceOp) List(ctx context.Context, priceRequest *PriceRequest) ([]Price, *Response, error)
type Reddit ¶
type Reddit struct { Subscribers int `json:"subscribers"` ActiveUsers int `json:"active_users"` CommunityCreation string `json:"community_creation"` PostsPerHour float64 `json:"posts_per_hour,string"` PostsPerDay float64 `json:"posts_per_day,string"` CommentsPerHour float64 `json:"comments_per_hour,string"` CommentsPerDay float64 `json:"comments_per_day"` Link string `json:"link"` Name string `json:"name"` Points int `json:"Points"` }
type SimilarItem ¶
type SocialStats ¶
type SocialStats struct { General General `json:"General"` CryptoCompare CryptoCompare `json:"CryptoCompare"` Twitter Twitter `json:"Twitter"` Reddit Reddit `json:"Reddit"` Facebook Facebook `json:"Facebook"` CodeRepository CodeRepository `json:"CodeRepository"` }
type SocialStatsService ¶
type SocialStatsServiceOp ¶
type SocialStatsServiceOp struct {
// contains filtered or unexported fields
}
func (*SocialStatsServiceOp) Get ¶
func (s *SocialStatsServiceOp) Get(ctx context.Context, coinExchangeId int) (*SocialStats, *Response, error)
type Twitter ¶
type Twitter struct { Followers int `json:"followers"` Following string `json:"following"` Lists int `json:"lists"` Favourites string `json:"favourites"` Statuses int `json:"statuses"` AccountCreation string `json:"account_creation"` Name string `json:"name"` Link string `json:"link"` Points int `json:"Points"` }