Documentation ¶
Index ¶
- Constants
- Variables
- func AESDecrypt(encrypted []byte, key []byte) (decrypted []byte)
- func AESEncrypt(src []byte, key []byte) (encrypted []byte)
- func AddTime(cur time.Time, h int, i int, s int) time.Time
- func AesDecrypt(encrypted string, key string) string
- func AesEncrypt(src string, key string) string
- func ArrayToSlice(array []interface{}) []interface{}
- func CamelString(s string) string
- func CamelStrings(in []string) (out []string)
- func China() *time.Location
- func ChinaSuffix() string
- func CleanPath(Path string) string
- func ColorPrint(s string, i int)
- func ColorPrintEnd()
- func ColorPrintStart(i int)
- func ContainsString(src []string, dest string) bool
- func Copy(from string, to string) error
- func CreatRandomInt(min, max int) int
- func CreateConfigFromYml(path string, node string, model interface{})
- func CreateDirForPath(Path string) error
- func CreateFile(filePath string, content []byte)
- func CreateMapInt() map[int]interface{}
- func CreateMapString() map[string]interface{}
- func CreateOrderSn(randLen int, prefix string, suffix string) string
- func CreateRand(randLen int) string
- func CreateRandString(len int) string
- func DbCreateFilter() map[string]interface{}
- func Debug(v interface{})
- func DifferenceStrings(src []string, dest []string) []string
- func DispatchToMany(name string, data interface{}, ctx context.Context)
- func DispatchToManySync(name string, data interface{}, ctx context.Context)
- func DispatchToOne(name string, data interface{}, ctx context.Context)
- func FileExist(path string) bool
- func FindAndOpen(path string) []byte
- func Float64ToInt(int64 float64) int
- func GetCurrentPath() string
- func GetDate(dateSep string) string
- func GetDateD() string
- func GetDateFromTimeYMDHIS(t time.Time, dateSep string, timeSep string, dateTimeSep string) string
- func GetDateM() string
- func GetDateTime() string
- func GetDateY() string
- func GetDateYMD(cur ...time.Time) string
- func GetDateYMDHIS(dateSep string, timeSep string, dateTimeSep string) string
- func GetDayEnd(cur time.Time) time.Time
- func GetDayStart(cur time.Time) time.Time
- func GetDays(year int, month int) (days int)
- func GetDebug() bool
- func GetLine() int
- func GetMonthEnd(cur time.Time) time.Time
- func GetMonthStart(cur time.Time) time.Time
- func GetTime(timeSep string) string
- func HasError(e error, other ...string) bool
- func HasSameWord(findIn string, find string) bool
- func HmacHs256(message string, secret string) string
- func Int64ToInt(int64 int64) int
- func IntersectionStrings(src []string, dest []string) []string
- func IsHasSame(slice1 []string, slice2 []string) bool
- func IsInArray(array []interface{}, find interface{}) int
- func IsStringInSlice(find string, findIn []string) bool
- func JsonLog(v interface{})
- func Lcfirst(str string) string
- func LcfirstArr(in []string) (out []string)
- func Listen(name string, handler Handler)
- func ListenJoin(name string, handler Handler)
- func Mapper(src interface{}, key string, v interface{}) interface{}
- func Match(str string, pattern string) bool
- func MatchAll(str string, pattern string) [][]string
- func Md5(str string) string
- func Now() *time.Time
- func Pow(x int, n int) int
- func PrintError(e error, other ...string) bool
- func PrintInfo(other ...string)
- func PrintLine()
- func PrintSuccess(other ...string)
- func PrintWarning(other ...string)
- func ReadFile(path string) []byte
- func ReplaceAll(str string, pattern string, replace string) string
- func Replaces(toReplace string, froms []string, tos []string) (rst string)
- func SHA256(message []byte) string
- func SetDebug(debug bool)
- func ShowColor()
- func SliceReverse(s Slice) []interface{}
- func SnakeString(s string) string
- func SnakeStrings(in []string) (out []string)
- func StringArrayUnique(orgSlice []string)
- func ThisLine() int
- func TimeToString(time time.Time) string
- func Trace(v interface{}, depth int)
- func Ucfirst(str string) string
- func UcfirstArr(in []string) (out []string)
- func UnionStrings(src []string, dest []string) []string
- type AuthEvent
- type BusToMany
- type BusToOne
- type ConsoleLogger
- type EzChannel
- type EzWaitGroup
- func (this *EzWaitGroup) Add(name string)
- func (this *EzWaitGroup) AddInt(name string, delta int)
- func (this *EzWaitGroup) Clear(name string)
- func (this *EzWaitGroup) CreateWaitGroup(name string) *sync.WaitGroup
- func (this *EzWaitGroup) Done(name string)
- func (this *EzWaitGroup) Get(name string) *sync.WaitGroup
- type FileLogger
- type FileTool
- type FileUpload
- type Handler
- type Ids
- type IntKeyMap
- type IntSlice
- type Logger
- func (this *Logger) InitConsoleLogger()
- func (this *Logger) InitFileLogger()
- func (this *Logger) InitMqLogger()
- func (this *Logger) Printf(format string, v ...interface{})
- func (this *Logger) UseConsoleLogger()
- func (this *Logger) UseFileLogger()
- func (this *Logger) UseMqLogger()
- func (this *Logger) UseNoLogger()
- type M
- type MqLogger
- type Process
- type Slice
- type StringKeyMap
- type Timer
- type YmlConfig
- type Zipper
Constants ¶
View Source
const ( C_Blue = 1 C_Green = 2 C_BlueLight = 11 C_White = 0 C_Yellow = 14 C_Red = 4 C_Pink = 14 C_Grey = 15 C_Purple = 5 )
View Source
const ( LoggerTypeFile = "file" LoggerTypeConsole = "console" LoggerTypeMq = "nsq" LoggerTypeNone = "none" )
Variables ¶
View Source
var B2M map[string][]Handler
View Source
var B2O map[string]Handler
View Source
var CloseHandle *syscall.LazyProc
View Source
var GLB *globals
View Source
var On = ListenJoin
下面是一些大家习惯使用的名称的别名方法
View Source
var OnOne = Listen
View Source
var S *serverConfig
View Source
var SetConsoleTextAttribute *syscall.LazyProc
View Source
var Trigger = DispatchToMany
View Source
var TriggerSync = DispatchToManySync
Functions ¶
func AESDecrypt ¶
func AESEncrypt ¶
func AesDecrypt ¶
func AesEncrypt ¶
func ArrayToSlice ¶
func ArrayToSlice(array []interface{}) []interface{}
func CamelString ¶
func CamelStrings ¶ added in v1.0.2
func ChinaSuffix ¶
func ChinaSuffix() string
func ColorPrint ¶
func ColorPrintEnd ¶
func ColorPrintEnd()
func ColorPrintStart ¶
func ColorPrintStart(i int)
func ContainsString ¶ added in v1.0.1
func CreatRandomInt ¶
func CreateConfigFromYml ¶ added in v1.0.1
func CreateDirForPath ¶
func CreateFile ¶
func CreateMapInt ¶
func CreateMapInt() map[int]interface{}
func CreateMapString ¶
func CreateMapString() map[string]interface{}
func CreateRand ¶
func CreateRandString ¶
func DbCreateFilter ¶
func DbCreateFilter() map[string]interface{}
func DifferenceStrings ¶ added in v1.0.1
DifferenceStrings 取前者src与后者dest两个字符串列表的差集
func DispatchToMany ¶ added in v1.0.1
func DispatchToManySync ¶ added in v1.0.1
func DispatchToOne ¶ added in v1.0.1
func FindAndOpen ¶ added in v1.0.1
func Float64ToInt ¶
func GetCurrentPath ¶
func GetCurrentPath() string
func GetDateFromTimeYMDHIS ¶
func GetDateTime ¶
func GetDateTime() string
func GetDateYMD ¶
func HasSameWord ¶
*
- @Description: 检测两组用空格分隔的字符串是否有相同的单词
- @receiver this
- @param findIn 原始字符串
- @param find 要搜索的字符串
- @return bool
func Int64ToInt ¶
func IntersectionStrings ¶ added in v1.0.1
IntersectionStrings 取两个字符串列表的交集
func IsStringInSlice ¶
func LcfirstArr ¶ added in v1.0.1
func ListenJoin ¶ added in v1.0.1
func PrintError ¶
func PrintSuccess ¶
func PrintSuccess(other ...string)
func PrintWarning ¶
func PrintWarning(other ...string)
func SliceReverse ¶
func SliceReverse(s Slice) []interface{}
func SnakeString ¶
func SnakeStrings ¶ added in v1.0.2
func StringArrayUnique ¶
func StringArrayUnique(orgSlice []string)
func TimeToString ¶
func UcfirstArr ¶ added in v1.0.1
func UnionStrings ¶ added in v1.0.1
UnionString 取两个字符串列表的并集
Types ¶
type ConsoleLogger ¶
文件日志
func NewConsoleLogger ¶
func NewConsoleLogger() *ConsoleLogger
func (*ConsoleLogger) Printf ¶
func (this *ConsoleLogger) Printf(format string, v ...interface{})
type EzWaitGroup ¶
var EzWg *EzWaitGroup
func GetWg ¶
func GetWg() *EzWaitGroup
func (*EzWaitGroup) Add ¶
func (this *EzWaitGroup) Add(name string)
func (*EzWaitGroup) AddInt ¶
func (this *EzWaitGroup) AddInt(name string, delta int)
func (*EzWaitGroup) Clear ¶
func (this *EzWaitGroup) Clear(name string)
func (*EzWaitGroup) CreateWaitGroup ¶
func (this *EzWaitGroup) CreateWaitGroup(name string) *sync.WaitGroup
func (*EzWaitGroup) Done ¶
func (this *EzWaitGroup) Done(name string)
type FileLogger ¶
type FileLogger struct { Root string //./var/ FilePath string //文件名,默认“/orm.log” Logger *log.Logger MaxSize int64 //最大容量,默认2M MaxLine int //最大行数,默认10000 // contains filtered or unexported fields }
文件日志
func NewFileLogger ¶
func NewFileLogger() *FileLogger
func (*FileLogger) CreateNewFile ¶
func (this *FileLogger) CreateNewFile() *os.File
func (*FileLogger) Printf ¶
func (this *FileLogger) Printf(format string, v ...interface{})
type FileUpload ¶
type Logger ¶
type Logger struct { Type string //默认写入文件 //配置 //-文件日志 FilePath string //mq日志 NsqPubAddr string Depth int DepthSkip int // contains filtered or unexported fields }
func CreateLogger ¶
func CreateLogger() *Logger
func (*Logger) InitConsoleLogger ¶
func (this *Logger) InitConsoleLogger()
func (*Logger) InitFileLogger ¶
func (this *Logger) InitFileLogger()
func (*Logger) InitMqLogger ¶
func (this *Logger) InitMqLogger()
func (*Logger) UseConsoleLogger ¶
func (this *Logger) UseConsoleLogger()
func (*Logger) UseFileLogger ¶
func (this *Logger) UseFileLogger()
func (*Logger) UseMqLogger ¶
func (this *Logger) UseMqLogger()
func (*Logger) UseNoLogger ¶
func (this *Logger) UseNoLogger()
type MqLogger ¶
type MqLogger struct { TopicName string NsqPubAddr string // contains filtered or unexported fields }
文件日志
func NewMqLogger ¶
type StringKeyMap ¶
type StringKeyMap map[string]interface{}
func (StringKeyMap) Len ¶
func (s StringKeyMap) Len() int
func (StringKeyMap) Less ¶
func (s StringKeyMap) Less(i, j string) bool
func (StringKeyMap) Swap ¶
func (s StringKeyMap) Swap(i, j string)
type YmlConfig ¶ added in v1.0.1
type YmlConfig struct {
FilePath string
}
func (*YmlConfig) SetFilePath ¶ added in v1.0.1
Source Files ¶
Click to show internal directories.
Click to hide internal directories.