utils

package
v0.0.0-...-63fa16a Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToString

func ByteToString(value []byte) string

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

func CreateDirs

func CreateDirs(paths ...string) error

CreateDirs create a directory based on a given paths

func DecodeBase64

func DecodeBase64(value string) (string, error)

DecodeBase64 returns a decoded string from base64

func EncodeBase64

func EncodeBase64(value string) string

EncodeBase64 returns a encoded string to base64

func ParseCheckboxBoolean

func ParseCheckboxBoolean(value string) bool

func RemoveDir

func RemoveDir(path string) error

func SanitizeString

func SanitizeString(s string) string

func SanitizeUrl

func SanitizeUrl(s string) string

func StringToByte

func StringToByte(value string) []byte

func WriteFile

func WriteFile(filepath string, s []byte) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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