utils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GetHttpError = errors.New("get http server error")
)

Functions

func Auto

func Auto(i time.Duration, keep func() (bool, error), debug bool)

func Failure

func Failure(err error, message string)

func If

func If(condition bool, trueVal, falseVal interface{}) interface{}

func Parse

func Parse(i interface{}, content []byte, debug bool) error

解析配置文件

func ParseConfig

func ParseConfig(config *Config, i interface{}, paths ...string) error

func Waits added in v1.0.3

func Waits(l int, do func(item int) (interface{}, error)) ([]interface{}, error)

Types

type Config

type Config struct {
	Debug    bool
	Interval time.Duration
	Reload   bool
	CallBack func()
}

func (*Config) TraceTime

func (config *Config) TraceTime(msg string) func()

Jump to

Keyboard shortcuts

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