util

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotesSuffix = ".sy"

Functions

func Debugger

func Debugger(a ...interface{})

Debugger 在这个函数内加上断点,方便调试

func DevLog

func DevLog(a ...interface{})

DevLog 仅在开发模式下打印

func FindAttr

func FindAttr(attrs [][]string, name string) (string, int, error)

FindAttr 返回值第一个参数是 attr 对应的值,没找到为空,第二个值为在 attrs 中的下标

func HTMLEntityDecoder

func HTMLEntityDecoder(s string) string

HTMLEntityDecoder

func IDTimeStrToTime

func IDTimeStrToTime(ID string) time.Time

IDTimeStrToTime IDTime=>20210607114722-dfaf

func IsID added in v0.5.0

func IsID(id string) bool

IsID 判断是否是 ID

func IsNotes

func IsNotes(path string) bool

IsNotes 判断该路径是不是笔记

func IsSkipPath

func IsSkipPath(path string) bool

func Log

func Log(a ...interface{})

Log 打印

func RenderError

func RenderError() string

RenderError 用于渲染失败的地方

func RunningLog

func RunningLog(serialNumber string, a ...interface{})

RunningLog 打印稍微带一些格式的运行时流程信息

func TimeFromID added in v0.4.2

func TimeFromID(id string) string

TimeFromID 从 id 中提取创建时间

func Warn

func Warn(a ...interface{})

Warn 警告

func WriteFile added in v0.5.2

func WriteFile(targetPath string, data []byte, perm os.FileMode) error

WriteFile 确保文件路径存在,且不超出 conf.outDir

Types

This section is empty.

Jump to

Keyboard shortcuts

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