define

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcdSymbolPrefix = "Symbol/"
	EtcdCoinPrefix   = "Coin/"
)

Variables

This section is empty.

Functions

func InitSymbolConfig

func InitSymbolConfig(key string, etcdConfig etcd.EtcdConfig, symbolInfo *SymbolInfo)

Types

type CoinInfo

type CoinInfo struct {
	CoinID   int32
	CoinName string
	Prec     int32
}

type RedisKey

type RedisKey string
const (
	Ticker                   RedisKey = "gex:ticker"
	Kline                    RedisKey = "gex:kline"
	AccountToken             RedisKey = "gex:account:token"
	AccountConsumedMessageId RedisKey = "gex:account:consumed:messageId"
	OrderConsumedMessageId   RedisKey = "gex:order:consumed:messageId"
)

func (RedisKey) WithParams

func (key RedisKey) WithParams(params ...string) string

func (RedisKey) WithSymbol

func (key RedisKey) WithSymbol(symbol string) string

type SymbolCoinConfig

type SymbolCoinConfig[Key string | int32, Value *SymbolInfo | *CoinInfo] map[Key]Value

func (SymbolCoinConfig[Key, Value]) CastToSyncMap

func (s SymbolCoinConfig[Key, Value]) CastToSyncMap() *sync.Map

type SymbolInfo

type SymbolInfo struct {
	SymbolName         string
	SymbolID           int32
	BaseCoinName       string
	BaseCoinID         int32
	QuoteCoinName      string
	QuoteCoinID        int32
	BaseCoinPrecValue  int32        `yaml:"baseCoinPrec"`
	QuoteCoinPrecValue int32        `yaml:"quoteCoinPrec"`
	BaseCoinPrec       atomic.Int32 `yaml:"-"`
	QuoteCoinPrec      atomic.Int32 `yaml:"-"`
}

Jump to

Keyboard shortcuts

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