Documentation ¶
Index ¶
- Constants
- func Debugf(format string, v ...interface{})
- func Debugln(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Errorln(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Fatalln(v ...interface{})
- func GetExternal() string
- func GetIntranetIp()
- func IPString2Long(ip string) uint
- func InetAton(ipnr net.IP) int64
- func InetNtoa(ipnr int64) net.IP
- func Infof(format string, v ...interface{})
- func Infoln(v ...interface{})
- func IpIsInlist(ip string, list []string) (isIn bool)
- func LevelSet(level int)
- func LogFilePath(p string) func(Logger) Logger
- func NewConf(filename string) error
- func NewErrorInfo(code int, info string) []byte
- func Warnf(format string, v ...interface{})
- func Warnln(v ...interface{})
- type CodeInfo
- type Config
- func (c *Config) Bool(key string) (bool, error)
- func (c *Config) Float64(key string) (float64, error)
- func (c *Config) GetArray(key string, v interface{}) (err error)
- func (c *Config) GetStruct(key string, v interface{}) (err error)
- func (c *Config) Int(key string) (int, error)
- func (c *Config) Int64(key string) (int64, error)
- func (config *Config) LastUpdateTimeGet() int64
- func (config *Config) Reload() error
- func (c *Config) String(key string) (string, error)
- func (config *Config) Watch()
- type LogLevel
- type Logger
- func AlsoStdout(l Logger) Logger
- func DebugLevel(l Logger) Logger
- func ErrorLevel(l Logger) Logger
- func EveryDay(l Logger) Logger
- func EveryHour(l Logger) Logger
- func EveryMinute(l Logger) Logger
- func EveryMonth(l Logger) Logger
- func EveryWeek(l Logger) Logger
- func FatalLevel(l Logger) Logger
- func InfoLevel(l Logger) Logger
- func PrintStack(l Logger) Logger
- func Start(decorators ...func(Logger) Logger) Logger
- func WarnLevel(l Logger) Logger
- type SimpleClock
Constants ¶
View Source
const ( SWITCH_ON = 1 SWITCH_OFF = 2 )
View Source
const ( OK = 0 ERR_UNKNOWN = 10000 ERR_NO_USER = 10001 ERR_LIMIT = 10002 )
View Source
const ( ErrUnknown = "未知错误" ErrNoUser = "用户信息不存在" ErrLimit = "限速" )
Variables ¶
This section is empty.
Functions ¶
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf prints formatted fatal log and exits.
func GetExternal ¶
func GetExternal() string
func GetIntranetIp ¶
func GetIntranetIp()
func IPString2Long ¶
func IpIsInlist ¶
func LogFilePath ¶
LogFilePath returns a function to set the log file path.
func NewErrorInfo ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents a configuration file.
var Conf *Config
func InstanceGet ¶
func InstanceGet() *Config
func (*Config) LastUpdateTimeGet ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the logger type.
func EveryMinute ¶
EveryMinute sets new log file created every minute.
func EveryMonth ¶
type SimpleClock ¶
func NewSimpleClock ¶
func NewSimpleClock(interval time.Duration, buckets int) *SimpleClock
func (*SimpleClock) Stop ¶
func (sc *SimpleClock) Stop()
Click to show internal directories.
Click to hide internal directories.