utils

package
v0.0.0-...-e394574 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: MIT Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthSign

func AuthSign(Id int, Email string, Password string) string

func AuthSignCheck

func AuthSignCheck(Id int, Email string, Password string, sign string) bool

func ComputedHandlerSeconds

func ComputedHandlerSeconds(startTime int64) float64

传入开始时间,计算结束时间

func LoginAuth

func LoginAuth(username, password string) smtp.Auth

func Pwd

func Pwd() string

获取当前工作目录

func SHA256Encode

func SHA256Encode(s string) string

func SendMail

func SendMail(to, subject, body string) error

func TimeDiffForHumans

func TimeDiffForHumans(t time.Time) string

将时间转换为人类可阅读的格式

func ToString

func ToString(i interface{}) string

func Url

func Url(url string, params ...interface{}) string

Types

type BootstrapPaginator

type BootstrapPaginator struct {
	Total       int64
	CurrentPage int64
	Url         string
	PerPage     int64
	TotalPage   int64
	Appends     map[string]string
}

func (*BootstrapPaginator) Append

func (bp *BootstrapPaginator) Append(params map[string]string)

func (*BootstrapPaginator) BuildUrl

func (bp *BootstrapPaginator) BuildUrl(Page int64) string

func (*BootstrapPaginator) ComputeTotalPage

func (bp *BootstrapPaginator) ComputeTotalPage()

func (*BootstrapPaginator) Instance

func (bp *BootstrapPaginator) Instance(total int64, currentPage int64, perPage int64, url string)

func (*BootstrapPaginator) Render

func (bp *BootstrapPaginator) Render() string

func (*BootstrapPaginator) RenderItem

func (bp *BootstrapPaginator) RenderItem(page int64) string

func (*BootstrapPaginator) RenderNextItem

func (bp *BootstrapPaginator) RenderNextItem() string

func (*BootstrapPaginator) RenderPrevItem

func (bp *BootstrapPaginator) RenderPrevItem() string

func (*BootstrapPaginator) RenderUselessItem

func (bp *BootstrapPaginator) RenderUselessItem() string

Jump to

Keyboard shortcuts

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