util

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Path string
}

File represents a file or director.

func NewFileWithPath

func NewFileWithPath(path string) *File

NewFileWithPath return a file with the specified path.

func (*File) Ext

func (file *File) Ext() string

Ext returns only the extension.

func (*File) GetPath

func (file *File) GetPath() string

GetPath returns the path.

func (*File) IsDir

func (file *File) IsDir() bool

IsDir returns true when the file represents a directory, otherwise false.

func (*File) ListFiles

func (file *File) ListFiles() ([]*File, error)

ListFiles returns a file list in the directory.

func (*File) ListFilesWithExtention

func (file *File) ListFilesWithExtention(targetExt string) ([]*File, error)

ListFilesWithExtention returns files which has the specified extensions in the directory.

func (*File) ListFilesWithRegexp

func (file *File) ListFilesWithRegexp(re *regexp.Regexp) ([]*File, error)

ListFilesWithExtention returns files which has the specified extensions in the directory.

Jump to

Keyboard shortcuts

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