utils

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToInt added in v1.0.2

func ByteToInt(data []byte) (int, error)

func Daemon added in v1.0.2

func Daemon()

守护执行

func Int64ToString added in v1.0.2

func Int64ToString(data int64) string

func IntToByte added in v1.0.2

func IntToByte(data int) []byte

func IntToString added in v1.0.2

func IntToString(data int) string

func StringToInt added in v1.0.2

func StringToInt(data string) (int, error)

func StringToInt64 added in v1.0.2

func StringToInt64(data string) (int64, error)

Types

type Config

type Config struct {
	Delayer Delayer
	Redis   Redis
}

配置数据

func LoadConfig

func LoadConfig(fileName string) Config

载入配置

type Delayer added in v1.0.2

type Delayer struct {
	Pid               string
	TimerInterval     int64
	BucketMaxLifetime int64
	AccessLog         string
	ErrorLog          string
}

delayer 节点数据

type Logger

type Logger struct {
	AccessLog string
	ErrorLog  string
}

日志类

func NewLogger

func NewLogger(config Config) Logger

创建实例

func (*Logger) Error

func (p *Logger) Error(message string, exit bool)

错误日志

func (*Logger) Info

func (p *Logger) Info(message string)

信息日志

type Redis

type Redis struct {
	Host            string
	Port            string
	Database        int
	Password        string
	MaxIdle         int
	MaxActive       int
	IdleTimeout     int64
	ConnMaxLifetime int64
}

redis 节点数据

Jump to

Keyboard shortcuts

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