exchange

package
v0.0.0-...-7fcd714 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllExchanges

func GetAllExchanges(j *jdb.JDB)

ReadAllExchanges reads in all of the data about all exchanges in the database

func GetBaseExchanges

func GetBaseExchanges(j *jdb.JDB)

GetBaseExchanges reads in all of the data about all exchanges in the database

func GetExchange

func GetExchange(slug string)

func GetExchanges

func GetExchanges(j *jdb.JDB)

GetExchanges reads in all of the data about all exchanges in the database

func ViewMarket

func ViewMarket(w http.ResponseWriter, r *http.Request)

Types

type CoinMarket

type CoinMarket struct {
	Exchange     string   `json:"exchange"`
	ExchangeSlug string   `json:"exslug"`
	Market       string   `json:"market"`
	Ticker       Currency `json:"ticker"`
}

type CoinMarkets

type CoinMarkets map[string]CoinMarket

type Currency

type Currency struct {
	Symbol string  `json:"symbol"`
	Ask    float64 `json:"ask"`
	Bid    float64 `json:"bid"`
	High   float64 `json:"high"`
	Last   float64 `json:"last"`
	Low    float64 `json:"low"`
	Volume float64 `json:"volume"`
}

type Exchange

type Exchange struct {
	Name string `json:"name"`
	Slug string `json:"slug"`
	Url  string `json:"url"`

	Description string   `json:"description"`
	Established string   `json:"established"`
	Country     string   `json:"country"`
	Volume      float64  `json:"volume"`
	Markets     []Market `json:"markets"`
}

func NewExchange

func NewExchange(slug string) (e *Exchange)

func (*Exchange) SetDescription

func (e *Exchange) SetDescription(description interface{})
func (e *Exchange) SetLogo(logo interface{})

func (*Exchange) SetName

func (e *Exchange) SetName(name interface{})

func (*Exchange) SetURL

func (e *Exchange) SetURL(url interface{})

type ExchangeQueries

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

func Queries

func Queries(j *jdb.JDB, col string) *ExchangeQueries

func (*ExchangeQueries) ExchangeHandler

func (eq *ExchangeQueries) ExchangeHandler(w http.ResponseWriter, r *http.Request)

CoinsHandler handles a request for coin data

func (*ExchangeQueries) ExchangesHandler

func (eq *ExchangeQueries) ExchangesHandler(w http.ResponseWriter, r *http.Request)

CoinsHandler handles a request for coin data

func (*ExchangeQueries) GetExchange

func (eq *ExchangeQueries) GetExchange(slug string) (Exchange, error)

func (*ExchangeQueries) GetExchangeMarket

func (eq *ExchangeQueries) GetExchangeMarket(exchange, market string) (Market, error)

func (*ExchangeQueries) GetExchangeMarkets

func (eq *ExchangeQueries) GetExchangeMarkets(exchange string) (map[string]Market, error)

func (*ExchangeQueries) GetExchanges

func (cq *ExchangeQueries) GetExchanges() Exchanges

func (*ExchangeQueries) MarketHandler

func (eq *ExchangeQueries) MarketHandler(w http.ResponseWriter, r *http.Request)

CoinsHandler handles a request for coin data

func (*ExchangeQueries) MarketsHandler

func (eq *ExchangeQueries) MarketsHandler(w http.ResponseWriter, r *http.Request)

CoinsHandler handles a request for coin data

func (*ExchangeQueries) SetExchange

func (eq *ExchangeQueries) SetExchange(src, slug string, get func(e *Exchange))

func (*ExchangeQueries) SetMarkets

func (eq *ExchangeQueries) SetMarkets(slug string, marketsSrc map[string]MarketSrc)

func (*ExchangeQueries) WriteExchange

func (cq *ExchangeQueries) WriteExchange(slug string, c interface{}) error

func (*ExchangeQueries) WriteMarkets

func (cq *ExchangeQueries) WriteMarkets(slug string, c interface{}) error

type ExchangeShort

type ExchangeShort struct {
	Name   string  `json:"name"`
	Slug   string  `json:"slug"`
	Volume float64 `json:"volume"`
}

type ExchangeSrc

type ExchangeSrc struct {
	Name    string
	Slug    string
	APIUrl  string
	Volume  float64
	Markets map[string]MarketSrc
	Ticker  ExchangeTicker
}

func (*ExchangeSrc) SetCurrencyMarket

func (e *ExchangeSrc) SetCurrencyMarket(market, symbol string, ask, bid, high, last, low, vol interface{})

type ExchangeTicker

type ExchangeTicker struct {
	Ask, Bid, High24, Last, Low24, Vol string
}

type Exchanges

type Exchanges struct {
	N int      `json:"n"`
	E []string `json:"e"`
}

type Market

type Market struct {
	Symbol     string     `json:"symbol"`
	Currencies []Currency `json:"currencies"`
}

type MarketSrc

type MarketSrc struct {
	Symbol     string
	Currencies map[string]Currency
}

type Markets

type Markets struct {
	N int               `json:"n"`
	M map[string]Market `json:"m"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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