config

package
v0.0.0-...-d0dd730 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

View Source
const DateFormat = "2006-01-02"

DateFormat is the format of the date used in the app

View Source
const ExternalCurrencyIssuer = ""

ExternalCurrencyIssuer is the placeholder in the DB for currencies external to stellar which have to no issuer

View Source
const TimeFormat = "2006-01-02 15:04:05"

TimeFormat is the format of the time used in the app

Variables

View Source
var CurrencyCodeToName = make(map[string]string)

CurrencyCodeToName holds relations from currency code to currency name

View Source
var ModelCols = map[string]DataColumns{
	"coinmetrics": {
		DateCol:         0,
		ExchangeRateCol: 4,
		SkipLines:       1,
	},
	"sauder": {
		DateCol:         1,
		ExchangeRateCol: 3,
		SkipLines:       2,
	},
}

ModelCols are the columns in the csv where the respective data is found

Functions

func ReadConfig

func ReadConfig(cmd *cobra.Command) error

ReadConfig parses and reads config file

Types

type CleanupConfig

type CleanupConfig struct {
	CleanupMinutesInterval  int
	HoursToKeepMinutelyData int
	HoursToKeepHourlyData   int
}

CleanupConfig imported from config file

type Config

type Config struct {
	LocalDownloadDir string
	HorizonURL       string

	CORSHosts []string

	DB                 DBConfig
	ImportTransactions []TransactionData
	Ticker             TickerConfig
	Cleanup            CleanupConfig

	Port            string
	SQLMigrationDir string
	ApplicationDir  string
	IsDevSystem     bool

	HTTPClient *http.Client
}

Config holds the data imported from the config file and command line

var Cnf *Config

Cnf holds configs

type DBConfig

type DBConfig struct {
	DBUser     string
	DBPassword string
	DBHost     string
	DBPort     int64
	DBName     string
	DBSchema   string
}

DBConfig imported from config file

type DataColumns

type DataColumns struct {
	DateCol         int
	ExchangeRateCol int
	SkipLines       int
}

DataColumns struct

type TickerConfig

type TickerConfig struct {
	TickSeconds                 int
	SourceCurrency              string
	DestinationCurrency         []string
	DecentralizedExchangeCode   []string
	DecentralizedExchangeDomain []string
	DecentralizedExchangeIssuer []string
}

TickerConfig imported from config file

type TransactionData

type TransactionData struct {
	Model                     string
	FileURL                   string
	SourceCurrency            string
	DestinationCurrency       string
	SourceCurrencyName        string
	DestinationCurrencyName   string
	SourceCurrencyIssuer      string
	DestinationCurrencyIssuer string
}

TransactionData holds data relevant for a transaction between two currencies

Jump to

Keyboard shortcuts

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