This repository has been archived on 2022-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
tacitus/product.go

38 lines
538 B
Go
Raw Permalink Normal View History

2018-01-11 22:03:54 -07:00
package tacitus
import (
"strings"
)
type Product string
const (
BtcUsd = "BTC-USD"
BtcEur = "BTC-EUR"
BtcGbp = "BTC-GBP"
BchUsd = "BCH-USD"
EthUsd = "ETH-USD"
EthBtc = "ETH-BTC"
EthEur = "ETH-EUR"
LtcUsd = "LTC-USD"
LtcBtc = "LTC-BTC"
LtcEur = "LTC-EUR"
)
var products = [...]string{BtcUsd, BtcEur, BtcGbp, BchUsd, EthUsd, EthBtc,
EthEur, LtcUsd, LtcBtc, LtcEur}
func ValidProduct(prod string) bool {
prod = strings.ToUpper(prod)
for _, p := range products {
if p == prod {
return true
}
}
return false
}