Documentation ¶
Index ¶
- func Escape(a string) string
- func GenRandomData(n int) []byte
- func IsExecutable(file os.FileInfo) bool
- func IsExecutableMode(mode os.FileMode) bool
- func IsSymLink(file os.FileInfo) bool
- func IsSymLinkMode(mode os.FileMode) bool
- func MakeLink(abs string, name string) string
- func RecursivelySizeOf(info *item.FileInfo, depth int) int64
- func RecursivelySizeOfGenerator(afs afero.Fs) func(info *item.FileInfo, depth int) int64
- func RemoveSep(s string) string
- func SplitNumberAndUnit(input string) (float64, string)
- type MockFileInfo
- type Once
- type SafeSet
- type Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Escape ¶
Escape * Tab is escaped as `\t`. * Carriage return is escaped as `\r`. * Line feed is escaped as `\n`. * Single quote is escaped as `\'`. * Double quote is escaped as `\"`. * Backslash is escaped as `\\`.
func GenRandomData ¶ added in v0.28.0
func IsExecutable ¶
func IsExecutableMode ¶
func IsSymLinkMode ¶
func RecursivelySizeOf ¶
RecursivelySizeOf returns the size of the file or directory depth < 0 means no limit
func RecursivelySizeOfGenerator ¶ added in v0.28.0
func SplitNumberAndUnit ¶ added in v0.27.0
SplitNumberAndUnit splits a string like "10bit" to 10 and "bit"
"12.3ml" to 12.4 and "ml"
"-1,234,213kg" to -1234213 and "kg"
Types ¶
type MockFileInfo ¶ added in v0.28.0
type MockFileInfo struct {
// contains filtered or unexported fields
}
func NewMockFileInfo ¶ added in v0.28.0
func (*MockFileInfo) IsDir ¶ added in v0.28.0
func (m *MockFileInfo) IsDir() bool
func (*MockFileInfo) ModTime ¶ added in v0.28.0
func (m *MockFileInfo) ModTime() time.Time
func (*MockFileInfo) Mode ¶ added in v0.28.0
func (m *MockFileInfo) Mode() os.FileMode
func (*MockFileInfo) Name ¶ added in v0.28.0
func (m *MockFileInfo) Name() string
func (*MockFileInfo) Size ¶ added in v0.28.0
func (m *MockFileInfo) Size() int64
func (*MockFileInfo) Sys ¶ added in v0.28.0
func (m *MockFileInfo) Sys() any
Click to show internal directories.
Click to hide internal directories.