utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckModuleVersion added in v0.0.12

func CheckModuleVersion(mods ...application.Module) error

CheckModuleVersion 检查各个模块的版本是否一致,如果不是就返回错误

func ComputeFileSHA256sum

func ComputeFileSHA256sum(file fs.Path) (util.Hex, error)

ComputeFileSHA256sum ...

func ComputeFileSHA256sumAFS added in v0.0.14

func ComputeFileSHA256sumAFS(file afs.Path) (util.Hex, error)

ComputeFileSHA256sumAFS ...

func ComputeSHA256sum added in v0.0.14

func ComputeSHA256sum(data []byte) util.Hex

ComputeSHA256sum ...

func CopyFile added in v0.1.1

func CopyFile(src, dst afs.Path, writeOption *afs.Options) (int64, error)

CopyFile 复制文件内容

Types

type ErrorList added in v0.1.1

type ErrorList struct {
	// contains filtered or unexported fields
}

ErrorList 表示一个可以包含多个错误的列表

func (*ErrorList) Append added in v0.1.1

func (inst *ErrorList) Append(err error)

Append 添加一个错误到列表末尾

func (*ErrorList) First added in v0.1.1

func (inst *ErrorList) First() error

First 取最第一个错误

func (*ErrorList) Last added in v0.1.1

func (inst *ErrorList) Last() error

Last 取最后一个错误

type GinUtils added in v0.0.14

type GinUtils struct{}

GinUtils ...

func (*GinUtils) HasFlag added in v0.0.14

func (inst *GinUtils) HasFlag(c *gin.Context, name string) bool

HasFlag 判断传入的 query 中是否包含指定的标志位

func (*GinUtils) ParseIDs added in v0.0.14

func (inst *GinUtils) ParseIDs(str string, sep string, fn func(n int)) error

ParseIDs 解析类似“1.2.3.4.5.”的参数

type PropertiesUtil added in v0.1.0

type PropertiesUtil struct{}

PropertiesUtil ...

func (*PropertiesUtil) GetNameList added in v0.1.0

func (inst *PropertiesUtil) GetNameList(src collection.Properties, prefix string, suffix string) []string

GetNameList 读取 src 中,通过 prefix 和 suffix 指定类型的名单

type Strings added in v0.1.1

type Strings struct{}

Strings 一组面向字符串的工具

func (*Strings) TrimToLower added in v0.1.1

func (inst *Strings) TrimToLower(s string) string

TrimToLower 移除两端空白,并准换为小写字符

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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