util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsPath

func AbsPath(path string) string

func FileType

func FileType(isDir bool) string

func FormatPath

func FormatPath(path string) string

func HashHex

func HashHex(h hash.Hash, file string) (string, error)

func ListFiles

func ListFiles(path string) (map[string]PathInfo, error)

func ListPath

func ListPath(path string, acceptFn func(info PathInfo) bool) (map[string]PathInfo, error)

func Md5

func Md5(file string) (string, error)

func PettyJson

func PettyJson(v any) string

func RelativePath

func RelativePath(path, root string) string

func Sha1

func Sha1(file string) (string, error)

func Sha256

func Sha256(file string) (string, error)

func Sha512

func Sha512(file string) (string, error)

func WalkPath

func WalkPath(root string, fn WalkFunc) error

Types

type PathInfo

type PathInfo struct {
	Relative string
	Path     string
	Info     fs.FileInfo
}

type WalkFunc

type WalkFunc func(info PathInfo, err error) error

Jump to

Keyboard shortcuts

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