helper

package
v0.0.0-...-9966579 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MulanPSL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormart  = "2006-01-02 15:04:05"
	TimeFormart2 = "2006-01-02 15:04:05.999"
)
View Source
const AuthKey string = "lxg1111111111111111111111111111111111"

Variables

View Source
var LOC, _ = time.LoadLocation("Asia/Shanghai")

Functions

func AESCbcDecrypt

func AESCbcDecrypt(secretKey, src string) string

func AESCbcEncrypt

func AESCbcEncrypt(secretKey, src string) string

func GetAbsPath

func GetAbsPath() string

func GetCurrentAbPath

func GetCurrentAbPath() string

最终方案-全兼容

func GetCurrentAbPathByExecutable

func GetCurrentAbPathByExecutable() string

获取当前执行文件绝对路径

func GetCurrentDirectory

func GetCurrentDirectory() string

func GetCurrentPath

func GetCurrentPath() (string, error)

func GetFileContent

func GetFileContent(filePath string) (string, error)

func GetFirstMacAddress

func GetFirstMacAddress() (string, error)

func IsTempDirRun

func IsTempDirRun() bool

func JsonFileToObject

func JsonFileToObject(filePath string, interfacePtr interface{}) error

func Lcfirst

func Lcfirst(str string) string

首字母小写

func Mkdir

func Mkdir(dir string)

func Padding

func Padding(plainText []byte, blockSize int) []byte

func PathExists

func PathExists(path string) bool

func RegisterConsulServer

func RegisterConsulServer()

func ToDateTime

func ToDateTime(context *gin.Context, paraName string) *time.Time

func ToInt

func ToInt(context *gin.Context, paraName string) int

func ToInt64

func ToInt64(context *gin.Context, paraName string) int64

func ToObject

func ToObject(sourceObj interface{}, destPtr interface{}) error

func ToString

func ToString(context *gin.Context, paraName string) string

func UnPadding

func UnPadding(plainText []byte) []byte

Types

type C_Datetime

type C_Datetime time.Time

func Now

func Now() C_Datetime

func (C_Datetime) After

func (t C_Datetime) After(u time.Time) bool

func (C_Datetime) Before

func (t C_Datetime) Before(u time.Time) bool

func (C_Datetime) Equal

func (t C_Datetime) Equal(u time.Time) bool

func (C_Datetime) EqualMinTime

func (t C_Datetime) EqualMinTime() bool

func (C_Datetime) Format

func (t C_Datetime) Format(format string) string

func (C_Datetime) MarshalJSON

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

func (C_Datetime) Now

func (t C_Datetime) Now() C_Datetime

func (C_Datetime) Unix

func (t C_Datetime) Unix() int64

func (*C_Datetime) UnmarshalJSON

func (t *C_Datetime) UnmarshalJSON(data []byte) (err error)

type C_float32

type C_float32 float32

func (*C_float32) UnmarshalJSON

func (t *C_float32) UnmarshalJSON(data []byte) (err error)

type C_int

type C_int int

func (*C_int) UnmarshalJSON

func (t *C_int) UnmarshalJSON(data []byte) (err error)

type C_int32

type C_int32 int32

func (*C_int32) UnmarshalJSON

func (t *C_int32) UnmarshalJSON(data []byte) (err error)

type HttpResponseInfo

type HttpResponseInfo struct {
	Content    interface{} `json:"content"`
	Message    string      `json:"message"`
	StatusCode int         `json:"statusCode"`
}

func GetHttpResponseInstance

func GetHttpResponseInstance() *HttpResponseInfo

func (HttpResponseInfo) Error

func (receiver HttpResponseInfo) Error(msg interface{}, c *gin.Context)

func (HttpResponseInfo) InvalidParameter

func (receiver HttpResponseInfo) InvalidParameter(c *gin.Context)

func (HttpResponseInfo) SessionInValid

func (receiver HttpResponseInfo) SessionInValid(c *gin.Context)

func (HttpResponseInfo) Success

func (receiver HttpResponseInfo) Success(content interface{}, c *gin.Context)

type JsonSnakeCase

type JsonSnakeCase struct {
	Value interface{}
}

func (JsonSnakeCase) MarshalJSON

func (c JsonSnakeCase) MarshalJSON() ([]byte, error)

type QueryFilter

type QueryFilter struct {
	PageIndex int
	PageSize  int
}

type QueryResult

type QueryResult struct {
	PageIndex    int         `json:"pageIndex"`
	PageSize     int         `json:"pageSize"`
	TotalPage    int64       `json:"totalPage"`
	PageCount    int64       `json:"pageCount"`
	TotalRecords int64       `json:"totalRecords"`
	ResultList   interface{} `json:"resultList"`
}

type ScheduleHelper

type ScheduleHelper struct {
}

func NewScheduleHelper

func NewScheduleHelper() *ScheduleHelper

func (*ScheduleHelper) Start

func (s *ScheduleHelper) Start(taskName string, duration time.Duration, f func())

Jump to

Keyboard shortcuts

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