lib

package
v0.0.0-...-294a70e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2020 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ENV_LOADED  bool   = false
	IS_DEV_MODE bool   = false
	USE_PPROF   bool   = false
	APP_NAME    string = ""
	APP_HOST    string = ""
	APP_PORT    int    = 0
)
View Source
var LogCenterSingle sync.Once

Functions

func AesCBCDncrypt

func AesCBCDncrypt(rawData string, key []byte) (string, error)

func AesCBCEncrypt

func AesCBCEncrypt(rawData, key []byte) (string, error)

func Cors

func Cors(ctx iris.Context)

func GetLogFile

func GetLogFile() *os.File

创建日志文件

func GetModelDBFieldNames

func GetModelDBFieldNames(module interface{}) (result map[string]string, err error)

通过反射转换,反向通过字段Tag信息查找字段名,然后转换成实际数据库字段名称

func LoadEnv

func LoadEnv() (err error)

func LogCenter

func LogCenter() *logrus.Logger

func Md5Hash

func Md5Hash(source string) string

func NewGuid

func NewGuid() (result uuid.UUID)

func NewGuidString

func NewGuidString() (result string)

func NewPprof

func NewPprof() context.Handler

New returns a new pprof (profile, cmdline, symbol, goroutine, heap, threadcreate, debug/block) Middleware. Note: Route MUST have the last named parameter wildcard named '{action:path}'

func ReadBody

func ReadBody(ctx iris.Context, jsonEncoder jsoniter.API, vModel interface_core.IViewModel) (err error)

func SHA1

func SHA1(data string) string

对字符串进行SHA1哈希

Types

type DateTime

type DateTime struct {
	time.Time
}

func (DateTime) MarshalJSON

func (t DateTime) MarshalJSON() ([]byte, error)

func (*DateTime) Scan

func (t *DateTime) Scan(v interface{}) error

Scan valueof time.Time

func (DateTime) Value

func (t DateTime) Value() (driver.Value, error)

Value insert timestamp into mysql need this function.

type ES_LogCenter

type ES_LogCenter struct {
	Log *logrus.Logger
}
var LogCenterInstance *ES_LogCenter

func (*ES_LogCenter) Init

func (m *ES_LogCenter) Init()

type QueryCondition

type QueryCondition struct {
	Page      int       `json:"page"`
	Size      int       `json:"size"`
	Sort      string    `json:"sort"`
	Order     string    `json:"order"`
	StartDate time.Time `json:"startDate"`
	EndDate   time.Time `json:"endDate"`
}

func NewQueryCondition

func NewQueryCondition() *QueryCondition

func (*QueryCondition) GetQuery

func (m *QueryCondition) GetQuery(tableName string, condition map[string]string, query *gorm.DB, countQuery *gorm.DB) (err error)

type UUIDTransformer

type UUIDTransformer struct {
}

func (*UUIDTransformer) Transformer

func (m *UUIDTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL