util

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFilesAll added in v1.1.0

func CopyFilesAll(thisDir, toDir string)

只支持单级目录的拷贝

func CreateFileWithContent added in v1.1.0

func CreateFileWithContent(content string, name ...string)

func IsExist added in v1.1.0

func IsExist(filename string) bool

func IsNotIn added in v1.1.0

func IsNotIn[T string | int | float32 | float64](arr []T, target T) bool

func MakeTemplateFile added in v1.1.0

func MakeTemplateFile(dir, name, tmpl string)

创建基础模板文件,分别传入模板名称(可自定义)。 其中dir有三个个可选值,分别是“posts”和“pages”以及“common”,对应文章、页面模板以及共用的模板

func RenderHandle added in v1.1.0

func RenderHandle(filename string) func(w http.ResponseWriter, r *http.Request)

func ReturnCategoryList added in v1.1.0

func ReturnCategoryList(posts *[]model.Post) []string

func SimpleMkdir added in v1.1.0

func SimpleMkdir(em ...string)

func TrimExt added in v1.1.0

func TrimExt(filename string) string

去除文件扩展名,可传入完整路径或文件BaseName

Types

This section is empty.

Jump to

Keyboard shortcuts

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