Documentation
¶
Overview ¶
Package pocket @author K·J Create at 2019-04-09 15:09
Package pocket @author K·J Create at 2019-04-09 15:11
Package pocket @author K·J Create at 2019-04-09 15:14
Package pocket @author K·J Create at 2019-04-15 15:04
Package log @author K·J Create at 2019-05-15 15:03
Package pocket K·J Create at 2020-04-09 21:30
Package pocket K·J Create at 2020-04-09 21:36
Package pocket K·J Create at 2020-04-09 21:09
Package pocket @author K·J Create at 2019-04-09 15:13
Package pocket @author K·J Create at 2019-04-09 15:10
Index ¶
- Variables
- func Any(condition func(interface{}) bool, args ...interface{}) bool
- func CreateCaptcha(digit int) string
- func DecodeQuery(dst interface{}, src map[string][]string) error
- func Decrypt(cipherText, key []byte) ([]byte, error)
- func Diff(origin interface{}, current interface{}) (string, string)
- func Each(action func(interface{}), args ...interface{})
- func Encrypt(plantText, key []byte) ([]byte, error)
- func Filter(condition func(int, interface{}) bool, data interface{}) (interface{}, error)
- func GetLogger() *logrus.Logger
- func GetUUID() uuid.UUID
- func InfluxQueryRow(c *client.Client, query client.Query) (*models.Row, error)
- func Md5(txt string) string
- func NewContextHook(levels ...logrus.Level) logrus.Hook
- func NilCondition(i interface{}) bool
- func PKCS7Padding(cipherText []byte, blockSize int) []byte
- func PKCS7UnPadding(plantText []byte) []byte
- func ReqToSql(model interface{}) (string, []interface{}, map[string][]string, error)
- func SnakeString(s string) string
- func Stom(columns []string) map[int]string
- func String(model interface{}) string
- func ToArray(array interface{}) []interface{}
- func ToString(origin interface{}, tag, joiner, separator string) string
- func UnixMillisecond() int64
- func UnixSecond() int64
- func UnmarshalInflux(columns map[int]string, data []interface{}, v interface{}) error
- func XormUpdateParam(model interface{}) (map[string]interface{}, error)
- type Api
- type Code
- type ContextHook
- type Fields
- type Level
- type Logback
- func (logback *Logback) Debug(v ...interface{})
- func (logback *Logback) Error(v ...interface{})
- func (logback *Logback) Info(v ...interface{})
- func (logback *Logback) SetLevel(level Level)
- func (logback *Logback) SetOutput(w io.Writer)
- func (logback *Logback) Trace(v ...interface{})
- func (logback *Logback) Warn(v ...interface{})
- func (logback *Logback) WithFields(fields Fields) *Logback
- type RedisConfig
- type RedisUtils
- type Resp
- type SqlBuilder
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DecodeQuery ¶ added in v0.0.3
DecodeQuery decode get query
func InfluxQueryRow ¶
InfluxQueryRow query row from influx
func NewContextHook ¶ added in v0.0.3
NewContextHook use to make an hook
func NilCondition ¶ added in v0.0.3
func NilCondition(i interface{}) bool
func PKCS7Padding ¶
PKCS7Padding aes pkcs
func SnakeString ¶ added in v0.0.3
SnakeString, XxYy to xx_yy , XxYY to xx_yy
func ToArray ¶ added in v0.0.3
func ToArray(array interface{}) []interface{}
[]class -> []interface{}
func UnmarshalInflux ¶
UnmarshalInflux convert influx db row to struct columns [index]:[column name] data row of values v struct tag:'influx'
func XormUpdateParam ¶ added in v0.0.3
Types ¶
type Api ¶
type Api interface { Info(v ...interface{}) Debug(v ...interface{}) Warn(v ...interface{}) Error(v ...interface{}) Trace(v ...interface{}) }
type ContextHook ¶ added in v0.0.3
ContextHook for log the call context
func (ContextHook) Fire ¶ added in v0.0.3
func (hook ContextHook) Fire(entry *logrus.Entry) error
Fire implement fire
func (ContextHook) Levels ¶ added in v0.0.3
func (hook ContextHook) Levels() []logrus.Level
Levels implement levels
type Level ¶
type Level uint32
Level type
const ( // PanicLevel level, highest level of severity. Logs and then calls panic with the // message passed to Debug, Info, ... PanicLevel Level = iota // FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the // logging level is set to Panic. FatalLevel // ErrorLevel level. Logs. Used for errors that should definitely be noted. // Commonly used for hooks to send errors to an error tracking service. ErrorLevel // WarnLevel level. Non-critical entries that deserve eyes. WarnLevel // InfoLevel level. General operational entries about what's going on inside the // application. InfoLevel // DebugLevel level. Usually only enabled when debugging. Very verbose logging. DebugLevel // TraceLevel level. Designates finer-grained informational events than the Debug. TraceLevel )
type Logback ¶
type Logback struct {
// contains filtered or unexported fields
}
func (*Logback) WithFields ¶
type RedisConfig ¶ added in v0.0.3
RedisConfig redis config
type RedisUtils ¶ added in v0.0.3
type RedisUtils struct {
// contains filtered or unexported fields
}
func NewRedis ¶ added in v0.0.3
func NewRedis(config RedisConfig) (*RedisUtils, error)
NewRedis get redis client
type SqlBuilder ¶ added in v0.0.3
type SqlBuilder struct { Table string Model interface{} }
func NewSqlBuilder ¶ added in v0.0.3
func NewSqlBuilder(table string, model interface{}) *SqlBuilder
NewSqlBuilder sql builder tag规则 `db:"column,add,set,sort"`
func (*SqlBuilder) BuildInsert ¶ added in v0.0.3
func (builder *SqlBuilder) BuildInsert() (string, []interface{}, error)
BuildInsert 生成批量插入sql
func (*SqlBuilder) BuildInsertRow ¶ added in v0.0.3
func (builder *SqlBuilder) BuildInsertRow() (string, []interface{}, error)
BuildInsertRow 生成单条插入sql