origins

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

TODO: check if it's possible to merge coinbase and coinbasepro

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyOriginResponse = fmt.Errorf("empty origin response received")
View Source
var ErrInvalidPrice = fmt.Errorf("invalid price from origin")
View Source
var ErrInvalidResponseStatus = fmt.Errorf("invalid response status from origin")
View Source
var ErrMissingResponseForPair = fmt.Errorf("no response for pair from origin")
View Source
var ErrUnknownOrigin = errors.New("unknown origin")

Functions

This section is empty.

Types

type Balancer

type Balancer struct {
	Pool query.WorkerPool
}

func (*Balancer) Fetch

func (s *Balancer) Fetch(pairs []Pair) []FetchResult

type Binance

type Binance struct {
	Pool query.WorkerPool
}

Binance origin handler

func (*Binance) Fetch

func (b *Binance) Fetch(pairs []Pair) []FetchResult

type BitThump

type BitThump struct {
	Pool query.WorkerPool
}

Bithumb origin handler

func (*BitThump) Fetch

func (c *BitThump) Fetch(pairs []Pair) []FetchResult

type Bitfinex

type Bitfinex struct {
	Pool query.WorkerPool
}

func (*Bitfinex) Fetch

func (o *Bitfinex) Fetch(pairs []Pair) []FetchResult

type Bitstamp

type Bitstamp struct {
	Pool query.WorkerPool
}

Bitstamp origin handler

func (*Bitstamp) Fetch

func (b *Bitstamp) Fetch(pairs []Pair) []FetchResult

type Bittrex

type Bittrex struct {
	Pool query.WorkerPool
}

Bittrex origin handler

func (*Bittrex) Fetch

func (b *Bittrex) Fetch(pairs []Pair) []FetchResult

type CoinMarketCap

type CoinMarketCap struct {
	Pool   query.WorkerPool
	APIKey string
}

Exchange handler

func (*CoinMarketCap) Fetch

func (c *CoinMarketCap) Fetch(pairs []Pair) []FetchResult

type CoinbasePro

type CoinbasePro struct {
	Pool query.WorkerPool
}

Coinbase origin handler

func (*CoinbasePro) Fetch

func (c *CoinbasePro) Fetch(pairs []Pair) []FetchResult

type CryptoCompare

type CryptoCompare struct {
	Pool query.WorkerPool
}

func (*CryptoCompare) Fetch

func (c *CryptoCompare) Fetch(pairs []Pair) []FetchResult

type Ddex

type Ddex struct {
	Pool query.WorkerPool
}

func (*Ddex) Fetch

func (o *Ddex) Fetch(pairs []Pair) []FetchResult

type FetchResult

type FetchResult struct {
	Price Price
	Error error
}

type Folgory

type Folgory struct {
	Pool query.WorkerPool
}

func (*Folgory) Fetch

func (o *Folgory) Fetch(pairs []Pair) []FetchResult

type Ftx

type Ftx struct {
	Pool query.WorkerPool
}

func (*Ftx) Fetch

func (o *Ftx) Fetch(pairs []Pair) []FetchResult

type Fx

type Fx struct {
	Pool   query.WorkerPool
	APIKey string
}

Fx exchange handler

func (*Fx) Fetch

func (f *Fx) Fetch(pairs []Pair) []FetchResult

type Gateio

type Gateio struct {
	Pool query.WorkerPool
}

Gateio exchange handler

func (*Gateio) Fetch

func (g *Gateio) Fetch(pairs []Pair) []FetchResult

type Gemini

type Gemini struct {
	Pool query.WorkerPool
}

Gemini origin handler

func (*Gemini) Fetch

func (g *Gemini) Fetch(pairs []Pair) []FetchResult

type Handler

type Handler interface {
	// Fetch should implement making API request to origin URL and
	// collecting/parsing origin data.
	Fetch(pairs []Pair) []FetchResult
}

Handler is interface that all Origin API handlers should implement.

type Hitbtc

type Hitbtc struct {
	Pool query.WorkerPool
}

Hitbtc exchange handler

func (*Hitbtc) Fetch

func (h *Hitbtc) Fetch(pairs []Pair) []FetchResult

type Huobi

type Huobi struct {
	Pool query.WorkerPool
}

Huobi origin handler

func (*Huobi) Fetch

func (h *Huobi) Fetch(pairs []Pair) []FetchResult

type Kraken

type Kraken struct {
	Pool query.WorkerPool
}

func (*Kraken) Fetch

func (o *Kraken) Fetch(pairs []Pair) []FetchResult

type Kucoin

type Kucoin struct {
	Pool query.WorkerPool
}

Kucoin origin handler

func (*Kucoin) Fetch

func (k *Kucoin) Fetch(pairs []Pair) []FetchResult

type Kyber

type Kyber struct {
	Pool query.WorkerPool
}

func (*Kyber) Fetch

func (o *Kyber) Fetch(pairs []Pair) []FetchResult

type Loopring

type Loopring struct {
	Pool query.WorkerPool
}

Loopring origin handler

func (*Loopring) Fetch

func (l *Loopring) Fetch(pairs []Pair) []FetchResult

type Okex

type Okex struct {
	Pool query.WorkerPool
}

Okex origin handler

func (*Okex) Fetch

func (o *Okex) Fetch(pairs []Pair) []FetchResult

type OpenExchangeRates

type OpenExchangeRates struct {
	Pool   query.WorkerPool
	APIKey string
}

OpenExchangeRates origin handler

func (*OpenExchangeRates) Fetch

func (c *OpenExchangeRates) Fetch(pairs []Pair) []FetchResult

type Pair

type Pair struct {
	Quote string
	Base  string
}

func (Pair) Equal

func (p Pair) Equal(c Pair) bool

func (Pair) String

func (p Pair) String() string

type Poloniex

type Poloniex struct {
	Pool query.WorkerPool
}

Poloniex origin handler

func (*Poloniex) Fetch

func (p *Poloniex) Fetch(pairs []Pair) []FetchResult

type Price

type Price struct {
	Pair      Pair
	Price     float64
	Bid       float64
	Ask       float64
	Volume24h float64
	Timestamp time.Time
}

type Set

type Set struct {
	// contains filtered or unexported fields
}

func NewSet

func NewSet(list map[string]Handler) *Set

func (*Set) Fetch

func (e *Set) Fetch(originPairs map[string][]Pair) map[string][]FetchResult

Fetch makes handler fetch using handlers from the Set structure.

func (*Set) Handlers

func (e *Set) Handlers() map[string]Handler

func (*Set) SetHandler

func (e *Set) SetHandler(name string, handler Handler)

type Sushiswap

type Sushiswap struct {
	Pool query.WorkerPool
}

func (*Sushiswap) Fetch

func (s *Sushiswap) Fetch(pairs []Pair) []FetchResult

type Uniswap

type Uniswap struct {
	Pool query.WorkerPool
}

func (*Uniswap) Fetch

func (u *Uniswap) Fetch(pairs []Pair) []FetchResult

type Upbit

type Upbit struct {
	Pool query.WorkerPool
}

func (*Upbit) Fetch

func (o *Upbit) Fetch(pairs []Pair) []FetchResult

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL