util

package
v0.0.0-...-1d8ee1f Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exist

func Exist(filename string) bool

Exist 判断文件是否存在

func GetReqID

func GetReqID(c *gin.Context) string

GetReqID 获取请求头中 X-Request-Id

func HTML

func HTML(input string) template.HTML

HTML 将 markdown 文档转换成 html 文件

func TimeToDate

func TimeToDate(t time.Time, format string) string

TimeToDate 格式化时间为日期

Types

type Pagination

type Pagination struct {
	CurrentPage int
	PerPage     int
	Total       int
}

func (*Pagination) AllPages

func (p *Pagination) AllPages() (pages int)

func (*Pagination) HasNext

func (p *Pagination) HasNext() bool

func (*Pagination) HasPrev

func (p *Pagination) HasPrev() bool

func (*Pagination) NextNum

func (p *Pagination) NextNum() int

func (*Pagination) PageRet

func (p *Pagination) PageRet() []int

func (*Pagination) PrevNum

func (p *Pagination) PrevNum() int

Jump to

Keyboard shortcuts

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