hs

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 6 Imported by: 32

README

hs

hs golang utils lib

Documentation

Index

Constants

View Source
const (
	GateIO = "gate"
	MXC    = "mxc"
	OKEx   = "okex"
	Huobi  = "huobi"
)

Variables

This section is empty.

Functions

func ConnectMongo added in v0.6.0

func ConnectMongo(ctx context.Context, conf MongoConf) (*mongo.Database, error)

func IsDuplicateError added in v0.6.0

func IsDuplicateError(err error) bool

func ParseJsonConfig

func ParseJsonConfig(filename string, config interface{}) error

Types

type ExchangeConf added in v0.5.1

type ExchangeConf struct {
	Name    string
	Label   string
	Symbols string // btc3l_usdt|btc3s_usdt
	Key     string
	Secret  string
	Host    string
}

type Grid added in v0.5.8

type Grid struct {
	Id         int
	Price      decimal.Decimal
	AmountBuy  decimal.Decimal
	AmountSell decimal.Decimal
	TotalBuy   decimal.Decimal
	Order      uint64
}

type GridStrategyConf added in v0.5.8

type GridStrategyConf struct {
	MaxPrice float64
	MinPrice float64
	Number   int
	Total    float64
}

type MongoConf added in v0.5.0

type MongoConf struct {
	// mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
	URI         string `json:"uri"`
	Database    string `json:"database"`
	MaxPoolSize uint64 `json:"maxPoolSize"`
	MinPoolSize uint64 `json:"minPoolSize"`
	AppName     string `json:"appName"`
}

type MySQLConf added in v0.5.0

type MySQLConf struct {
	URI string `json:"uri"`
}

type RestGridStrategyConf added in v0.5.8

type RestGridStrategyConf struct {
	MaxPrice  float64
	MinPrice  float64
	Number    int
	Total     float64
	Rebalance bool
	Interval  string // sleep interval
}

type SQLiteConf added in v0.5.8

type SQLiteConf struct {
	Location string
}

Directories

Path Synopsis
exchange

Jump to

Keyboard shortcuts

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