serve

package
Version: v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(strategy Strategy) (err error)

Serve 加载策略并执行

func SetupStrategyFromConfig

func SetupStrategyFromConfig(strategy Strategy) (err error)

SetupStrategyFromConfig 根据配置文件设置策略参数

Types

type MyLogger

type MyLogger struct {
	Path        string // 文件路径,如:./app.log
	Level       string // 日志输出的级别
	MaxFileSize int    // 日志文件大小的最大值,单位(M)
	MaxBackups  int    // 最多保留备份数
	MaxAge      int    // 日志文件保存的时间,单位(天)
	Compress    bool   // 是否压缩
	Caller      bool   // 日志是否需要显示调用位置
	JsonFormat  bool   // 是否以Json格式输出
	Stdout      bool   // 是否输出到控制台
	// contains filtered or unexported fields
}

func NewMyLogger

func NewMyLogger(path string, level string, jsonFormat bool) *MyLogger

func (*MyLogger) Debug

func (l *MyLogger) Debug(args ...interface{})

func (*MyLogger) Debugf

func (l *MyLogger) Debugf(template string, args ...interface{})

func (*MyLogger) Debugw

func (l *MyLogger) Debugw(msg string, keysAndValues ...interface{})

func (*MyLogger) Error

func (l *MyLogger) Error(args ...interface{})

func (*MyLogger) Errorf

func (l *MyLogger) Errorf(template string, args ...interface{})

func (*MyLogger) Errorw

func (l *MyLogger) Errorw(msg string, keysAndValues ...interface{})

func (*MyLogger) Info

func (l *MyLogger) Info(args ...interface{})

func (*MyLogger) Infof

func (l *MyLogger) Infof(template string, args ...interface{})

func (*MyLogger) Infow

func (l *MyLogger) Infow(msg string, keysAndValues ...interface{})

func (*MyLogger) Sync

func (l *MyLogger) Sync()

func (*MyLogger) Warn

func (l *MyLogger) Warn(args ...interface{})

func (*MyLogger) Warnf

func (l *MyLogger) Warnf(template string, args ...interface{})

func (*MyLogger) Warnw

func (l *MyLogger) Warnw(msg string, keysAndValues ...interface{})

type SConfig

type SConfig struct {
	Log       SLog                   `toml:"log"`
	Exchanges []SExchange            `toml:"exchange"`
	Options   map[string]interface{} `toml:"option"`
}

type SExchange

type SExchange struct {
	Name       string `toml:"name"`
	DebugMode  bool   `toml:"debug_mode"`
	AccessKey  string `toml:"access_key"`
	SecretKey  string `toml:"secret_key"`
	Passphrase string `toml:"passphrase"`
	Testnet    bool   `toml:"testnet"`
	WebSocket  bool   `toml:"websocket"`
}

type SLog

type SLog struct {
	Path  string `toml:"path"` // 运行日志
	Level string `toml:"level"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL