Documentation ¶
Index ¶
- Variables
- func CreateNewDB() error
- func GetCurrencyByCode(code string, issuer string, insertIfNotFound bool) (currency *models.Currency, err error)
- func GetCurrentRate(sourceCurrency *models.Currency, destinationCurrency *models.Currency) (lastTransaction *models.CurrentChartDataMinutely, err error)
- func GetSchemaForQuery() string
- func HandlePanic(function string, message string)
- func InsertCurrencyToDB(currencyCode string, currencyIssuer string) error
- func TruncateHistoryTable() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Flags = flag.NewFlagSet("goose", flag.ExitOnError) DB *sql.DB )
Global vars
Functions ¶
func GetCurrencyByCode ¶
func GetCurrencyByCode(code string, issuer string, insertIfNotFound bool) (currency *models.Currency, err error)
GetCurrencyByCode returns currency model if exists, if not and the flag is set it adds the currency and returns it
func GetCurrentRate ¶
func GetCurrentRate(sourceCurrency *models.Currency, destinationCurrency *models.Currency) (lastTransaction *models.CurrentChartDataMinutely, err error)
GetCurrentRate returns latest exchange available between 2 currencies
func GetSchemaForQuery ¶
func GetSchemaForQuery() string
GetSchemaForQuery returns string to use as schema inside queries
func HandlePanic ¶
HandlePanic general panic handler
func InsertCurrencyToDB ¶
InsertCurrencyToDB adds new currency to db
func TruncateHistoryTable ¶
func TruncateHistoryTable() error
TruncateHistoryTable deletes the history data from the db
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.