xos

package
v29.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSONFile  = "json"
	ProtoFile = "proto"
	YAMLFile  = "yaml"
	YMLFile   = "yml"
)

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(srcPath, dstPath string) error

CopyFile copy the source file to the destination file.

func CopyFolder

func CopyFolder(srcPath, dstPath string) error

CopyFolder copy the source folder to the destination folder.

func FileExists

func FileExists(filename string) bool

FileExists check if a file from a given path exists.

func FindFiles

func FindFiles(directory string, options ...FindFileOptions) ([]string, error)

FindFiles searches for files in the specified directory based on the given options. It supports filtering files by extension and prefix. Returns a list of matching files or an error.

func RemoveAllUnderHome

func RemoveAllUnderHome(path string) error

func Rename

func Rename(oldPath, newPath string) error

Rename copy oldPath to newPath and then delete oldPath. Unlike os.Rename, it doesn't fail when the oldPath and newPath are in different partitions (error: invalid cross-device link).

func ValidateFolderCopy added in v29.1.0

func ValidateFolderCopy(srcPath, dstPath string, exclude ...string) ([]string, error)

ValidateFolderCopy validates that all files in source folder exist in destination folder with same name and relative path.

Types

type FindFileOptions

type FindFileOptions func(o *findFileOptions)

func WithExtension

func WithExtension(extension string) FindFileOptions

WithExtension adds a file extension to the search options. It can be called multiple times to add multiple extensions.

func WithPrefix

func WithPrefix(prefix string) FindFileOptions

Jump to

Keyboard shortcuts

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