Documentation ¶
Overview ¶
Package pocket Create at 2020-11-06 10:17
Package pocket Create at 2020-11-06 10:23
Package pocket Create at 2021-01-29 10:17
Package pocket Create at 2020-11-25 10:08
Package pocket Create at 2020-11-06 10:18
Package kit Create at 2020-12-01 11:11
Package kit Create at 2020-11-06 10:20
Package pocket Create at 2020-12-01 11:35
Package pocket Create at 2020-11-06 10:20
Index ¶
- Variables
- func CreateNumberCaptcha(digit int) string
- func DecodeQuery(dst interface{}, src map[string][]string) error
- func Export(sheets []Sheet) (*bytes.Buffer, error)
- func FloatMax(a, b float64) float64
- func FloatMin(a, b float64) float64
- func GetDay(t time.Time) int
- func GetDaysOfMonth(year int, month int) (days int)
- func GetDaysOfMonthByTime(t time.Time) (days int)
- func GetMonth(t time.Time) int
- func GetUUID() uuid.UUID
- func GetUUIDStr() string
- func GetYear(t time.Time) int
- func HexStr2Uint16(s string) (uint16, error)
- func HexStr2Uint32(s string) (uint32, error)
- func HexStr2Uint64(s string) (uint64, error)
- func Import(reader io.Reader, sheets map[string]Sheet) error
- func IntMax(a, b int64) int64
- func IntMin(a, b int64) int64
- func ListAllFiles(path string) ([]string, error)
- func Md5(txt string) string
- func Pow(x, n int64) int64
- func SnakeString(s string) string
- func SonyFlakeId() (uint64, error)
- func UnixMillisecond() int64
- func UnixSecond() int64
- func Utf8Index(str, substr string) int
- func XormUpdateParam(model interface{}) (map[string]interface{}, error)
- type Api
- type Column
- type Fields
- type Format
- type Formatter
- 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 Sheet
- type SqlBuilder
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DecodeQuery ¶
DecodeQuery decode get query
func GetDaysOfMonth ¶
GetDaysOfMonth days in month
func GetDaysOfMonthByTime ¶
GetDaysOfMonthByTime days in month
func HexStr2Uint16 ¶
HexStr2Uint16 hex string to uint16
func HexStr2Uint32 ¶
HexStr2Uint32 hex string to uint32
func HexStr2Uint64 ¶
HexStr2Uint64 hex string to uint64
func ListAllFiles ¶
func Utf8Index ¶
Utf8Index Index returns the index of the first instance of substr in s, or -1 if substr is not present in s
func XormUpdateParam ¶
Types ¶
type Api ¶
type Api interface { Info(v ...interface{}) Debug(v ...interface{}) Warn(v ...interface{}) Error(v ...interface{}) Trace(v ...interface{}) }
type Column ¶
type Column struct { Width float64 // 单元格宽度 Merge bool // 是否合并 MergeExclude string // 合并排除 Style string // 单元格样式,覆盖Sheet的ContentStyle // contains filtered or unexported fields }
Column 单元格设置
type Format ¶
type Format interface {
// contains filtered or unexported methods
}
Format format value
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 ¶
RedisConfig redis config
type RedisUtils ¶
type Sheet ¶
type Sheet struct { Name string `json:"name"` // sheet 名称 T reflect.Type `json:"-"` // 列的类型 Result *[]interface{} `json:"result,omitempty"` // 导入结果 Content []interface{} `json:"content,omitempty"` // 导出数据 HeaderStyle string `json:"-"` // 头部单元格样式 ContentStyle string `json:"-"` // 内容单元格样式 Panes []string `json:"-"` Columns map[string]Column `json:"-"` // 内容单元格详细设置 }
Sheet 表
type SqlBuilder ¶
type SqlBuilder struct { Table string Model interface{} Cond interface{} }
func NewSqlBuilder ¶
func NewSqlBuilder(table string, model interface{}) *SqlBuilder
NewSqlBuilder sql builder tag规则 `db:"column,add,set,sort"`
func (*SqlBuilder) BuildInsert ¶
func (builder *SqlBuilder) BuildInsert() (string, []interface{}, error)
BuildInsert 生成批量插入sql
func (*SqlBuilder) BuildInsertRow ¶
func (builder *SqlBuilder) BuildInsertRow() (string, []interface{}, error)
BuildInsertRow 生成单条插入sql
func (*SqlBuilder) Condition ¶
func (builder *SqlBuilder) Condition(c interface{}) *SqlBuilder
BuildInsertRow 生成单条插入sql