helper

package
v0.0.0-...-5284134 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func AbstractCache

func AbstractCache() cache.AbstractCache

获取缓存服务

func Ajax

func Ajax(msg any, errcode int64, this *pine.Context)

Ajax Ajax返回数据给前端

func App

func App() *pine.Application

获取应用实例

func AppPath

func AppPath() string

func Bytes2String

func Bytes2String(b []byte) *string

func ConvertToAnySlice

func ConvertToAnySlice[T any](s []T) []any

func GetCallerFuncName

func GetCallerFuncName() string

GetCallerFuncName 获取当前执行函数名 只用于日志记录

func GetLocation

func GetLocation() *time.Location

func GetMd5

func GetMd5(str string) string

GetMd5 md5加密字符串

func GetORM

func GetORM() *xorm.Engine

func GetRandomString

func GetRandomString(l int) string

func GetRootPath

func GetRootPath(relPath ...string) string

GetRootPath 获取项目根目录 (即 main.go的所在位置)

func GetTimeStamp

func GetTimeStamp() int

GetTimeStamp 获取时间戳

func GetUrlPrefix

func GetUrlPrefix(catid int64) string

获取Url前缀

func HandleArtListInfo

func HandleArtListInfo(list []map[string]string, titlelen int)

处理文章列表信息数据. 补全一些cms生成

func InArray

func InArray(val any, array any) (exists bool, index int)

func Inject

func Inject(key any, v any, single ...bool)

Inject 注入依赖

func IsFalse

func IsFalse(args ...any) bool

IsFalse 检测字段是否为 空 0 nil

func IsWindows

func IsWindows() bool

func Krand

func Krand(size int, kind int) []byte

Krand 随机字符串

func NewOrmLogFile

func NewOrmLogFile(path string) *os.File

func NowDate

func NowDate(str string) string

NowDate 当前时间 Y m d H:i:s

func PanicErr

func PanicErr(err error, msg ...string)

PanicErr 抛出异常

func Password

func Password(password, encrypt string) string

Password 生成密码

func ToInterfaces

func ToInterfaces(values any) []any

func ToTableTime

func ToTableTime(t string) tables.LocalTime

func UcFirst

func UcFirst(str string) string

Types

type DirInfo

type DirInfo struct {
	Label    string `json:"label"`
	FullPath string `json:"full_path"`
	IsDir    bool   `json:"is_dir"`
	Children any    `json:"children"`
}

func DirTree

func DirTree(dir string) []DirInfo

type EmailOpt

type EmailOpt struct {
	Title        string
	UrlOrMessage string
	Address      []string
}

type Page

type Page struct {
	// contains filtered or unexported fields
}

func NewPage

func NewPage(urlPrefix string, curPage, prePage, total int, params map[string][]string, dynamic bool) *Page

func (*Page) GetFirst

func (p *Page) GetFirst() string

func (*Page) GetLast

func (p *Page) GetLast() string

func (*Page) GetNext

func (p *Page) GetNext() string

func (*Page) GetPrev

func (p *Page) GetPrev() string

func (*Page) HasNext

func (p *Page) HasNext() bool

func (*Page) HasPrev

func (p *Page) HasPrev() bool

func (*Page) String

func (p *Page) String() string

Jump to

Keyboard shortcuts

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