util

package
v0.0.0-...-fa9b265 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHostname

func GetHostname() string

GetHostname 获取服务器主机名称

func MD5

func MD5(data []byte) string

MD5 md5

func NewRedisPool

func NewRedisPool(cfg *config.RedisCfg) *redis.Pool

NewRedisPool new redis pool

func Sha1WithByte

func Sha1WithByte(data []byte) []byte

Sha1WithByte Sha1WithByte

func Sha256WithByte

func Sha256WithByte(data []byte) []byte

Sha256WithByte Sha256

func Sha256WithString

func Sha256WithString(data string) []byte

Sha256WithString Sha256

Types

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task task

func (*Task) SetHandler

func (tk *Task) SetHandler(h func(interface{}) error)

SetHandler 设置任务函数

type TaskSchedule

type TaskSchedule struct {
	// contains filtered or unexported fields
}

TaskSchedule 任务调度器

func NewTaskSchedule

func NewTaskSchedule() *TaskSchedule

NewTaskSchedule new task shcedule

func (*TaskSchedule) AddTask

func (schedule *TaskSchedule) AddTask(sencond int, bizid int64, t *Task) error

AddTask add task

Jump to

Keyboard shortcuts

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