config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(file string, ac *AppConfig) error

LoadConfig parse json config and return config object

Types

type AWSConfig

type AWSConfig struct {
	Region                       string `json:"aws_region"`
	AccessKeyID                  string `json:"aws_access_key_id"`
	SecretKey                    string `json:"aws_secret_access_key"`
	Token                        string `json:"aws_token"`
	ExpiredStatDataBucketName    string `json:"aws_expired_stat_data_bucket_name"`
	ExpiredReserveDataBucketName string `json:"aws_expired_reserve_data_bucket_name"`
	LogBucketName                string `json:"aws_log_bucket_name"`
}

AWSConfig ...

type AppConfig

type AppConfig struct {
	Authentication       Authentication `json:"authentication"`
	AWSConfig            AWSConfig      `json:"aws_config"`
	KeyStorePath         string         `json:"keystore_path"`
	Passphrase           string         `json:"passphrase"`
	KeyStoreDepositPath  string         `json:"keystore_deposit_path"`
	PassphraseDeposit    string         `json:"passphrase_deposit"`
	HTTPAPIAddr          string         `json:"http_api_addr"`
	SimulationRunnerAddr string         `json:"http_simulation_runner_addr"`

	ExchangeEndpoints   ExchangeEndpoints               `json:"exchange_endpoints"`
	WorldEndpoints      WorldEndpoints                  `json:"world_endpoints"`
	ContractAddresses   ContractAddresses               `json:"contract_addresses"`
	TokenSet            TokenSet                        `json:"tokens"`
	SettingDB           string                          `json:"setting_db"`
	DataDB              string                          `json:"data_db"`
	DepositAddressesSet ExchangesTokensDepositAddresses `json:"deposit_addresses"`
	Node                Node                            `json:"nodes"`
	HoubiKeystorePath   string                          `json:"keystore_intermediator_path"`
	HuobiPassphrase     string                          `json:"passphrase_intermediate_account"`

	BinanceKey    string `json:"binance_key"`
	BinanceSecret string `json:"binance_secret"`
	BinanceDB     string `json:"binance_db"`

	HuobiKey    string `json:"huobi_key"`
	HuobiSecret string `json:"huobi_secret"`
	HuobiDB     string `json:"huobi_db"`

	FetcherDelay FetcherDelay `json:"fetcher_delay"`
}

AppConfig represnet for app configuration

func DefaultAppConfig

func DefaultAppConfig() AppConfig

DefaultAppConfig ... set default value, currently only delay fetcher set, other should be explicit set

type Authentication

type Authentication struct {
	KNSecret               string `json:"kn_secret"`
	KNReadOnly             string `json:"kn_readonly"`
	KNConfiguration        string `json:"kn_configuration"`
	KNConfirmConfiguration string `json:"kn_confirm_configuration"`
}

Authentication config

type ContractAddresses

type ContractAddresses struct {
	Proxy   common.Address `json:"proxy"`
	Reserve common.Address `json:"reserve"`
	Wrapper common.Address `json:"wrapper"`
	Pricing common.Address `json:"pricing"`
}

ContractAddresses ...

type DepositAddresses

type DepositAddresses map[string]common.Address

DepositAddresses ..

type ExchangeEndpoints

type ExchangeEndpoints struct {
	Binance SiteConfig `json:"binance"`
	Houbi   SiteConfig `json:"houbi"`
}

ExchangeEndpoints ...

type ExchangesTokensDepositAddresses

type ExchangesTokensDepositAddresses map[string]DepositAddresses

ExchangesTokensDepositAddresses ..

type FetcherDelay

type FetcherDelay struct {
	OrderBook     HumanDuration `json:"order_book"`
	AuthData      HumanDuration `json:"auth_data"`
	RateFetching  HumanDuration `json:"rate_fetching"`
	BlockFetching HumanDuration `json:"block_fetching"`
	GlobalData    HumanDuration `json:"global_data"`
}

FetcherDelay ...

type HumanDuration

type HumanDuration time.Duration

func (*HumanDuration) UnmarshalJSON

func (d *HumanDuration) UnmarshalJSON(text []byte) error

type Node

type Node struct {
	Main   string   `json:"main"`
	Backup []string `json:"backup"`
}

type SiteConfig

type SiteConfig struct {
	URL string `json:"url"`
}

SiteConfig contain config for a remote api access

type Token

type Token struct {
	Address  string `json:"address"`
	Name     string `json:"name"`
	Decimals int64  `json:"decimals"`
	Internal bool   `json:"internal use"`
	Active   bool   `json:"listed"`
}

Token present for a token

type TokenSet

type TokenSet map[string]Token

TokenSet ..

type WorldEndpoints

type WorldEndpoints struct {
	GoldData        SiteConfig `json:"gold_data"`
	OneForgeGoldETH SiteConfig `json:"one_forge_gold_eth"`
	OneForgeGoldUSD SiteConfig `json:"one_forge_gold_usd"`
	GDAXData        SiteConfig `json:"gdax_data"`
	KrakenData      SiteConfig `json:"kraken_data"`
	GeminiData      SiteConfig `json:"gemini_data"`

	CoinbaseBTC SiteConfig `json:"coinbase_btc"`
	GeminiBTC   SiteConfig `json:"gemini_btc"`

	CoinbaseUSDC SiteConfig `json:"coinbase_usdc"`
	BinanceUSDC  SiteConfig `json:"binance_usdc"`
	CoinbaseUSD  SiteConfig `json:"coinbase_usd"`
	CoinbaseDAI  SiteConfig `json:"coinbase_dai"`
	HitDai       SiteConfig `json:"hit_dai"`

	BitFinexUSDT SiteConfig `json:"bit_finex_usdt"`
	BinanceUSDT  SiteConfig `json:"binance_usdt"`
	BinancePAX   SiteConfig `json:"binance_pax"`
	BinanceTUSD  SiteConfig `json:"binance_tusd"`
}

WorldEndpoints hold detail information to fetch feed(url,header, api key...)

Jump to

Keyboard shortcuts

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