Documentation ¶
Overview ¶
Ebase frame for daemon program Author Jonsen Yang Date 2013-07-05 Copyright (c) 2013 ForEase Times Technology Co., Ltd. All rights reserved.
Ebase frame for daemon program Author Jonsen Yang Date 2013-07-05 Copyright (c) 2013 ForEase Times Technology Co., Ltd. All rights reserved.
Index ¶
- Constants
- Variables
- func CreatePid()
- func Daemon(nochdir, noclose int) int
- func DelFiles(files []os.FileInfo, count int, fileDir string)
- func EbaseInit()
- func FileGetContent(file string) (string, error)
- func FileMTime(file string) (int64, error)
- func FilePutContent(file string, content string) (int, error)
- func FileSize(file string) (int64, error)
- func GetHost(req *http.Request) string
- func GetInt64Str(d int64) string
- func GetIntArrToStr(i []int, d string) (s string)
- func GetIntStr(d int) string
- func GetStrFloat64(s string) float64
- func GetStrInt(d string) int
- func GetStrInt64(d string) int64
- func GetStrUint(d string) uint
- func GetStrUint32(d string) uint32
- func GetStrUint64(d string) uint64
- func GetTimeAgo(t int64) (s string)
- func GetUint64Str(d uint64) string
- func GetUintStr(d uint) string
- func Help()
- func IsExist(path string) bool
- func IsFile(file string) bool
- func LoadConfig(configFile string) (cfg *config.Config)
- func Md5(key string) string
- func Mkdir(src string) error
- func NewXorm(opt *OrmOption) (orm *xorm.Engine, err error)
- func Rename(file, to string) error
- func SignalHandle(funcs map[string]interface{})
- func Unlink(file string) error
- type AuthClients
- type BaseLog
- func (l *BaseLog) Critical(v ...interface{})
- func (l *BaseLog) Criticalf(format string, v ...interface{})
- func (l *BaseLog) Debug(v ...interface{})
- func (l *BaseLog) Debugf(format string, v ...interface{})
- func (l *BaseLog) Error(v ...interface{})
- func (l *BaseLog) Errorf(format string, v ...interface{})
- func (l *BaseLog) Info(v ...interface{})
- func (l *BaseLog) Infof(format string, v ...interface{})
- func (l *BaseLog) Panic(v ...interface{})
- func (l *BaseLog) Panicf(format string, v ...interface{})
- func (l *BaseLog) Printf(format string, v ...interface{})
- func (l *BaseLog) Println(v ...interface{})
- func (l *BaseLog) Trace(v ...interface{})
- func (l *BaseLog) Tracef(format string, v ...interface{})
- func (l *BaseLog) Warn(v ...interface{})
- func (l *BaseLog) Warnf(format string, v ...interface{})
- type Cache
- type FileRepos
- type KeyValue
- type LogOptions
- type MailMessage
- type Mailer
- type Map
- type ModelOption
- type Models
- type OrmOption
- type PageOptions
- type Redis
- func (self *Redis) GetRedisKey(keys ...interface{}) (key string)
- func (self *Redis) RedisDelete(keys ...interface{}) (bool, error)
- func (self *Redis) RedisDeleteAll(keys ...interface{}) (s bool, err error)
- func (self *Redis) RedisExists(keys ...interface{}) (bool, error)
- func (self *Redis) RedisGet(keys ...interface{}) (value []byte, err error)
- func (self *Redis) RedisGetJson(v interface{}, keys ...interface{}) (err error)
- func (self *Redis) RedisIncr(keys ...interface{}) (int64, error)
- func (self *Redis) RedisSet(expire int64, value interface{}, keys ...interface{}) (err error)
- func (self *Redis) RedisSetJson(expire int64, mp interface{}, keys ...interface{}) (err error)
- type RedisOption
- type Repository
- type Smtp
Constants ¶
View Source
const ( LevelCritical = iota LevelError LevelWarning LevelInfo LevelDebug LevelTrace )
Log levels to control the logging output.
Variables ¶
Functions ¶
func FilePutContent ¶
put string to file
func GetTimeAgo ¶
func LoadConfig ¶
func SignalHandle ¶
func SignalHandle(funcs map[string]interface{})
Types ¶
type AuthClients ¶
type AuthClients []interface{}
func LoadAuthClients ¶
func LoadAuthClients(auths string) AuthClients
func (AuthClients) ClientAuthor ¶
func (clients AuthClients) ClientAuthor(ipAddr net.IP) bool
type BaseLog ¶
func NewLog ¶
func NewLog(opt *LogOptions) (l *BaseLog)
New log example:
opt := &LogOptions{Type: logType, File: logFile, Level: logLevel, Flag: logFlag} log := NewLog(opt)
type FileRepos ¶
type FileRepos []Repository
type LogOptions ¶
type MailMessage ¶
type MailMessage struct { From mail.Address // if From.Address is empty, Config.DefaultFrom will be used To []mail.Address Cc []mail.Address Bcc []mail.Address Subject string Content string S *Smtp }
func (*MailMessage) Send ¶
func (self *MailMessage) Send() error
func (*MailMessage) String ¶
func (self *MailMessage) String() string
http://tools.ietf.org/html/rfc822 http://tools.ietf.org/html/rfc2821
type ModelOption ¶
type ModelOption struct { Orm OrmOption Redis RedisOption }
type Models ¶
type Models struct { Orm *xorm.Engine OrmCache bool OrmCacheTime int64 Redis *Redis RedisEnable bool RedisPrefix string Driver string }
var Dbh *Models
func NewDefaultModels ¶
func NewModels ¶
func NewModels(opt *ModelOption) (*Models, error)
type PageOptions ¶
type Redis ¶
func NewRedis ¶
func NewRedis(opt *RedisOption) (*Redis, error)
func (*Redis) GetRedisKey ¶
func (*Redis) RedisDelete ¶
func (*Redis) RedisDeleteAll ¶
func (*Redis) RedisExists ¶
func (*Redis) RedisGetJson ¶
func (*Redis) RedisSetJson ¶
type RedisOption ¶
type Repository ¶
type Smtp ¶
type Smtp struct { SmtpUserName string SmtpHost, SmtpUser, SmtpPassword string SmtpPort int SmtpAuth, SmtpTLS, SmtpDaemon bool // contains filtered or unexported fields }
SMTP setup
func (*Smtp) MailSender ¶
func (*Smtp) NewMailMessage ¶
func (s *Smtp) NewMailMessage(m *Mailer) *MailMessage
Click to show internal directories.
Click to hide internal directories.