utils

package
v0.0.0-...-03386ae Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IOUtils

type IOUtils struct {
}

func IO

func IO() *IOUtils

func (*IOUtils) CopyDir

func (i *IOUtils) CopyDir(src string, dest string) error

复制整个路径到目标位置

func (*IOUtils) CopyFile

func (i *IOUtils) CopyFile(src string, dst string) error

复制文件到目标路径

func (*IOUtils) CopyFileFromReader

func (i *IOUtils) CopyFileFromReader(srcFile io.Reader, dst string) error

通过Reader复制文件

func (*IOUtils) GetRuntimePath

func (i *IOUtils) GetRuntimePath(filename string) string

获取运行时目录

func (*IOUtils) JsonFileToStruct

func (i *IOUtils) JsonFileToStruct(jsonSrc string, obj interface{}) error

将本地的JSON文件读取并转换成指定的结构体

func (*IOUtils) PathExists

func (i *IOUtils) PathExists(path string) bool

判断指定路径文件是否存在

func (*IOUtils) ReplaceStrToFile

func (i *IOUtils) ReplaceStrToFile(content, path string) error

将内容覆盖到指定文件,如果文件不存在那么创建,如果文件存在那么覆盖

func (*IOUtils) StructToJsonFile

func (i *IOUtils) StructToJsonFile(jsonSrc string, obj interface{}) error

将结构体序列化成JSON并保存到文件

type StringUtils

type StringUtils struct {
}

func String

func String() *StringUtils

func (*StringUtils) GetFileSuffixName

func (i *StringUtils) GetFileSuffixName(fileName string) (error, string)

获取文件的后缀名

func (*StringUtils) Uuid

func (i *StringUtils) Uuid(withoutLine bool) string

生成UUID

Jump to

Keyboard shortcuts

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