38 lines
538 B
Go
38 lines
538 B
Go
|
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
|
||
|
}
|