GxMisc

package
v0.0.0-...-6664dcb Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceLevel = iota
	DebugLevel
	WarnLevel
	ErrorLevel
	InfoLevel
	FatalLevel
)

Variables

View Source
var Config *Json

Functions

func BufToMsg

func BufToMsg(buf []byte) (*Json, error)

func ConnectRedis

func ConnectRedis(host string, port int, db int64) error

func Debug

func Debug(format string, v ...interface{})

func Error

func Error(format string, v ...interface{})

func Fatal

func Fatal(format string, v ...interface{})

func GetLevel

func GetLevel() int

获取日志级别

func Info

func Info(format string, v ...interface{})

func InitLogger

func InitLogger(logFileName string)

func JsonToStruct

func JsonToStruct(js *Json, u interface{})

func LoadConfig

func LoadConfig(filename string)

func LoadFromRedis

func LoadFromRedis(client *redis.Client, info interface{}) error

func MsgToBuf

func MsgToBuf(msg interface{}) ([]byte, error)

func PopRedisClient

func PopRedisClient() *redis.Client

func PushRedisClient

func PushRedisClient(client *redis.Client)

func SaveToRedis

func SaveToRedis(client *redis.Client, info interface{})

func SetIsOutputScreen

func SetIsOutputScreen(isOutput bool)

func SetLevel

func SetLevel(l int)

func StructName

func StructName(s interface{}) string

func Trace

func Trace(format string, v ...interface{})

func Warn

func Warn(format string, v ...interface{})

Types

type Counter

type Counter struct {
	C     uint32
	Mutex *sync.Mutex
}

func NewCounter

func NewCounter() *Counter

func (*Counter) Genarate

func (counter *Counter) Genarate() uint32

Jump to

Keyboard shortcuts

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