conf

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseYaml

func ParseYaml(configFile string) error

Types

type Chain

type Chain struct {
	WssRpcUrl       string `yaml:"wss_rpc_url"`
	HttpRpcUrl      string `yaml:"http_rpc_url"`
	PrivateKey      string `yaml:"private_key"`
	Key             *ecdsa.PrivateKey
	ChainID         uint64 `yaml:"chain_id"`
	ContractAddress string `yaml:"contract_address"`
	ContractAddr    common.Address
	Name            string   `yaml:"name"`
	SuppirtCoins    []string `yaml:"support_coins"`
}

type CoinAmountLimit

type CoinAmountLimit struct {
	Name      string  `yaml:"name"`
	MinAmount float64 `yaml:"min_amount"`
	MaxAmount float64 `yaml:"max_amount"`
}

type CrossChain

type CrossChain struct {
	SrcChainId  uint64 `yaml:"src_chain_id"`
	DestChainId uint64 `yaml:"dest_chain_id"`
}

type CrossChainCoin

type CrossChainCoin struct {
	Name     string `yaml:"name"`
	CoinType string `yaml:"type"`
}

type CrossChainFee

type CrossChainFee struct {
	Name      string  `yaml:"name"`
	Fixed     float64 `yaml:"fixed"`
	FloatRate float64 `yaml:"float_rate"`
}

type Log

type Log struct {
	Path  string `yaml:"path"`
	Level string `yaml:"level"`
}

type MySQL

type MySQL struct {
	Uri     string `yaml:"uri"`
	ShowSQL bool   `yaml:"show_sql"`
}

type MysGateConfig

type MysGateConfig struct {
	SupportChains     map[uint64]*Chain
	SupportCrossChain map[uint64][]uint64
	Coins             map[string]*CrossChainCoin
	Fee               map[string]*CrossChainFee
	Limit             map[string]*CoinAmountLimit
	Router            *Router            `yaml:"router"`
	SupportCoins      []string           `yaml:"support_coins"`
	CoinAmountLimits  []*CoinAmountLimit `yaml:"cross_chain_coin_limit"`
	CrossChainCoins   []*CrossChainCoin  `yaml:"cross_chain_coins"`
	Crosschainfee     []*CrossChainFee   `yaml:"cross_chain_fees"`
	Chains            []*Chain           `yaml:"chains"`
	Crosschains       []*CrossChain      `yaml:"cross_chains"`
	Service           *Service           `yaml:"service"`
	Logger            *Log               `yaml:"log"`
	Debug             bool               `yaml:"debug"`
	MySql             *MySQL             `yaml:"mysql"`
	ZkVerify          *ZkVerify          `yaml:"zk_verify"`
}

func GetConfig

func GetConfig() *MysGateConfig

func (*MysGateConfig) FindCrossChain

func (c *MysGateConfig) FindCrossChain(cid uint64) *Chain

func (*MysGateConfig) GetChainKey

func (cfg *MysGateConfig) GetChainKey(chain *Chain) (keys []string)

func (*MysGateConfig) GetCoinLimit

func (c *MysGateConfig) GetCoinLimit(coin string) *CoinAmountLimit

func (*MysGateConfig) GetCrossChainFee

func (c *MysGateConfig) GetCrossChainFee(coin string) *CrossChainFee

type Router

type Router struct {
	Type    string   `yaml:"type"`
	Porters []string `yaml:"porters"`
}

type Service

type Service struct {
	ServicePort string `yaml:"service_port"`
}

type ZkVerify

type ZkVerify struct {
	Enable   bool   `yaml:"enable"`
	ProofUrl string `yaml:"proof_url"`
}

Jump to

Keyboard shortcuts

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