utils

package
v0.0.0-...-08ecd07 Latest Latest
Warning

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

Go to latest
Published: May 23, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(source string, dest string) (err error)

Recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist.

func CopyFile

func CopyFile(source string, dest string) (err error)

Copies file source to destination dest.

func DateFormat

func DateFormat(t *time.Time, format string) string

func FileSize

func FileSize(size int64) string

func Gravatar

func Gravatar(email string, size string) string

generate gravatar link by email.

func Html2Excerpt

func Html2Excerpt(html string, length int) string

func Html2Str

func Html2Str(html string) string

func IsASCII

func IsASCII(str string) bool

func IsContain

func IsContain(str string, contain string) bool

func IsDir

func IsDir(path string) bool

func IsEmail

func IsEmail(str string) bool

func IsEmptyString

func IsEmptyString(str string) bool

func IsEnglish

func IsEnglish(str string) bool

func IsFile

func IsFile(path string) bool

func IsLonger

func IsLonger(str string, length int) bool

func IsShorter

func IsShorter(str string, length int) bool

func IsURL

func IsURL(str string) bool

func Markdown2Html

func Markdown2Html(text string) string

func Markdown2HtmlTemplate

func Markdown2HtmlTemplate(text string) template.HTML

func Now

func Now() *time.Time

func ReadMemStats

func ReadMemStats() *monitorStats

func Sha1

func Sha1(raw string) string

func SubString

func SubString(str string, begin, length int) (substr string)

Types

type Pager

type Pager struct {
	Current   int64
	Size      int64
	Total     int64
	Pages     int64
	PageSlice []int64
	Begin     int64
	End       int64
	Prev      int64
	Next      int64
	IsPrev    bool
	IsNext    bool
	IsValid   bool
}

func NewPager

func NewPager(page, size, total int64) *Pager

Jump to

Keyboard shortcuts

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