Files
sendico/api/fx/ingestor/internal/model/connector.go
Stephan D 62a6631b9a
All checks were successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
service backend
2025-11-07 18:35:26 +01:00

31 lines
501 B
Go

package model
import (
"context"
"strings"
)
type Driver string
const (
DriverBinance Driver = "BINANCE"
DriverCoinGecko Driver = "COINGECKO"
)
func (d Driver) String() string {
return string(d)
}
func (d Driver) IsEmpty() bool {
return strings.TrimSpace(string(d)) == ""
}
func NormalizeDriver(d Driver) Driver {
return Driver(strings.ToUpper(strings.TrimSpace(string(d))))
}
type Connector interface {
ID() Driver
FetchTicker(ctx context.Context, symbol string) (*Ticker, error)
}