Documentation ¶
Index ¶
- Constants
- Variables
- func Convert2SizeString(size SizeUnit) string
- type ContentFilter
- func (cf *ContentFilter) AppendToLengthFixed(fixed ...LengthFixed)
- func (cf *ContentFilter) AppendToOptions(options ...ContentOption)
- func (cf *ContentFilter) EnableGroup(renderer *render.Renderer) ContentOption
- func (cf *ContentFilter) EnableOwner(renderer *render.Renderer) ContentOption
- func (cf *ContentFilter) EnableSum(sumTypes ...SumType) ContentOption
- func (cf *ContentFilter) GetDisplayItems(e ...os.FileInfo) []*display.Item
- func (cf *ContentFilter) SetOptions(options ...ContentOption)
- func (cf *ContentFilter) SetSortFunc(sortFunc func(a, b os.FileInfo) bool)
- func (cf *ContentFilter) SortFunc() func(a, b os.FileInfo) bool
- type ContentFunc
- type ContentOption
- type InodeEnabler
- type LengthFixed
- type LinkEnabler
- type MimeFileTypeEnabler
- type Name
- func (n *Name) Enable() ContentOption
- func (n *Name) GitByName(name string, status string, style gitStyle) string
- func (n *Name) SetClassify() *Name
- func (n *Name) SetFileType() *Name
- func (n *Name) SetGit() *Name
- func (n *Name) SetIcon() *Name
- func (n *Name) SetParent(parent string) *Name
- func (n *Name) SetQuote(quote string) *Name
- func (n *Name) SetRenderer(renderer *render.Renderer) *Name
- func (n *Name) SetStatistics(Statistics *Statistics)
- func (n *Name) Statistics() *Statistics
- func (n *Name) UnsetClassify() *Name
- func (n *Name) UnsetFileType() *Name
- func (n *Name) UnsetGit() *Name
- func (n *Name) UnsetIcon() *Name
- func (n *Name) UnsetQuote() *Name
- type RelativeTimeEnabler
- type Size
- type SizeEnabler
- func (s *SizeEnabler) DisableTotal()
- func (s *SizeEnabler) EnableSize(size SizeUnit) ContentOption
- func (s *SizeEnabler) Recursive() *SizeRecursive
- func (s *SizeEnabler) Reset()
- func (s *SizeEnabler) SetEnableTotal()
- func (s *SizeEnabler) SetRecursive(sr *SizeRecursive)
- func (s *SizeEnabler) SetRenderer(renderer *render.Renderer)
- func (s *SizeEnabler) Size2String(b int64, blank int) string
- func (s *SizeEnabler) SizeUint() SizeUnit
- func (s *SizeEnabler) Total() (size int64, ok bool)
- type SizeRecursive
- type SizeUnit
- type Statistics
- type SumType
- type TypeFilter
- type TypeFunc
- func ExactFileTypeOnly(fileTypes ...string) TypeFunc
- func ExtOnly(ext ...string) TypeFunc
- func GlobOnly(globPattern ...string) (TypeFunc, error)
- func RemoveByExt(ext ...string) TypeFunc
- func RemoveExactFileType(fileTypes ...string) TypeFunc
- func RemoveGitIgnore(repoPath git.GitRepoPath) TypeFunc
- func RemoveGlob(globPattern ...string) (TypeFunc, error)
Constants ¶
View Source
const ( GitStyleDot gitStyle = iota GitStyleSym GitStyleDefault = GitStyleDot )
View Source
const ( OwnerName = "owner" OwnerUidName = "owner-uid" OwnerSID = "owner-sid" )
View Source
const ( GroupName = "group" GroupUidName = "group-uid" GroupSID = "group-sid" )
View Source
const Inode = "Inode"
View Source
const MimeTypeName = "mine type"
View Source
const NameName = "name"
View Source
const Permissions = "Permissions"
View Source
const RelativeTime = "Relative-time"
View Source
const SizeName = "Size"
View Source
const SumName = "sum"
Variables ¶
View Source
var ( Uid = false Gid = false )
View Source
var DirOnly = func(e os.FileInfo) bool {
return e.IsDir()
}
View Source
var RemoveBackups = func(e os.FileInfo) bool { return !strings.HasSuffix(e.Name(), "~") }
View Source
var RemoveDir = func(e os.FileInfo) bool {
return !e.IsDir()
}
Functions ¶
func Convert2SizeString ¶ added in v0.5.0
Types ¶
type ContentFilter ¶
type ContentFilter struct {
// contains filtered or unexported fields
}
func NewContentFilter ¶
func NewContentFilter(options ...ContentOption) *ContentFilter
func (*ContentFilter) AppendToLengthFixed ¶ added in v0.5.1
func (cf *ContentFilter) AppendToLengthFixed(fixed ...LengthFixed)
func (*ContentFilter) AppendToOptions ¶ added in v0.5.0
func (cf *ContentFilter) AppendToOptions(options ...ContentOption)
func (*ContentFilter) EnableGroup ¶ added in v0.3.1
func (cf *ContentFilter) EnableGroup(renderer *render.Renderer) ContentOption
func (*ContentFilter) EnableOwner ¶ added in v0.3.1
func (cf *ContentFilter) EnableOwner(renderer *render.Renderer) ContentOption
func (*ContentFilter) EnableSum ¶ added in v0.5.0
func (cf *ContentFilter) EnableSum(sumTypes ...SumType) ContentOption
func (*ContentFilter) GetDisplayItems ¶ added in v0.6.0
func (cf *ContentFilter) GetDisplayItems(e ...os.FileInfo) []*display.Item
func (*ContentFilter) SetOptions ¶ added in v0.4.0
func (cf *ContentFilter) SetOptions(options ...ContentOption)
func (*ContentFilter) SetSortFunc ¶ added in v0.5.0
func (cf *ContentFilter) SetSortFunc(sortFunc func(a, b os.FileInfo) bool)
type ContentFunc ¶
type ContentOption ¶
func EnableFileMode ¶
func EnableFileMode(renderer *render.Renderer) ContentOption
EnableFileMode return file mode like -rwxrwxrwx/drwxrwxrwx
func EnableTime ¶
func EnableTime(format string, mode string, renderer *render.Renderer) ContentOption
type InodeEnabler ¶ added in v0.5.1
func NewInodeEnabler ¶ added in v0.5.1
func NewInodeEnabler() *InodeEnabler
func (*InodeEnabler) Enable ¶ added in v0.5.1
func (i *InodeEnabler) Enable(renderer *render.Renderer) ContentOption
type LengthFixed ¶ added in v0.5.1
type LengthFixed interface { Done() Wait() Add(delta int) }
type LinkEnabler ¶ added in v0.7.0
func NewLinkEnabler ¶ added in v0.7.0
func NewLinkEnabler() *LinkEnabler
func (*LinkEnabler) Enable ¶ added in v0.7.0
func (l *LinkEnabler) Enable() ContentOption
type MimeFileTypeEnabler ¶ added in v0.7.0
func NewMimeFileTypeEnabler ¶ added in v0.7.0
func NewMimeFileTypeEnabler() *MimeFileTypeEnabler
func (*MimeFileTypeEnabler) Enable ¶ added in v0.7.0
func (e *MimeFileTypeEnabler) Enable() ContentOption
type Name ¶ added in v0.3.0
type Name struct {
Icon, Classify, FileType bool
Renderer *render.Renderer
GitCache *cached.Map[git.GitRepoPath, *git.FileGits]
GitStyle gitStyle
Quote string
// contains filtered or unexported fields
}
func NewNameEnable ¶ added in v0.3.0
func NewNameEnable() *Name
func (*Name) Enable ¶ added in v0.3.0
func (n *Name) Enable() ContentOption
func (*Name) SetClassify ¶ added in v0.3.0
func (*Name) SetFileType ¶ added in v0.3.0
SetFileType set file type, should set Classify first if Classify is false, FileType will be ignored
func (*Name) SetRenderer ¶ added in v0.3.0
func (*Name) SetStatistics ¶ added in v0.7.0
func (n *Name) SetStatistics(Statistics *Statistics)
func (*Name) Statistics ¶ added in v0.7.0
func (n *Name) Statistics() *Statistics
func (*Name) UnsetClassify ¶ added in v0.3.0
func (*Name) UnsetFileType ¶ added in v0.3.0
func (*Name) UnsetQuote ¶ added in v0.7.0
type RelativeTimeEnabler ¶ added in v0.5.8
func NewRelativeTimeEnabler ¶ added in v0.5.8
func NewRelativeTimeEnabler() *RelativeTimeEnabler
func (*RelativeTimeEnabler) Enable ¶ added in v0.5.8
func (r *RelativeTimeEnabler) Enable(renderer *render.Renderer) ContentOption
type SizeEnabler ¶ added in v0.5.1
func NewSizeEnabler ¶ added in v0.5.1
func NewSizeEnabler() *SizeEnabler
func (*SizeEnabler) DisableTotal ¶ added in v0.5.1
func (s *SizeEnabler) DisableTotal()
func (*SizeEnabler) EnableSize ¶ added in v0.5.1
func (s *SizeEnabler) EnableSize(size SizeUnit) ContentOption
func (*SizeEnabler) Recursive ¶ added in v0.7.0
func (s *SizeEnabler) Recursive() *SizeRecursive
func (*SizeEnabler) Reset ¶ added in v0.5.1
func (s *SizeEnabler) Reset()
func (*SizeEnabler) SetEnableTotal ¶ added in v0.5.1
func (s *SizeEnabler) SetEnableTotal()
func (*SizeEnabler) SetRecursive ¶ added in v0.7.0
func (s *SizeEnabler) SetRecursive(sr *SizeRecursive)
func (*SizeEnabler) SetRenderer ¶ added in v0.5.1
func (s *SizeEnabler) SetRenderer(renderer *render.Renderer)
func (*SizeEnabler) Size2String ¶ added in v0.5.1
func (s *SizeEnabler) Size2String(b int64, blank int) string
func (*SizeEnabler) SizeUint ¶ added in v0.5.1
func (s *SizeEnabler) SizeUint() SizeUnit
func (*SizeEnabler) Total ¶ added in v0.5.1
func (s *SizeEnabler) Total() (size int64, ok bool)
type SizeRecursive ¶ added in v0.7.0
type SizeRecursive struct {
// contains filtered or unexported fields
}
func NewSizeRecursive ¶ added in v0.7.0
func NewSizeRecursive(depth int) *SizeRecursive
type SizeUnit ¶ added in v0.3.1
type SizeUnit float64
const Unknown SizeUnit = -1
func ConvertFromSizeString ¶ added in v0.5.0
type Statistics ¶ added in v0.7.0
type Statistics struct {
// contains filtered or unexported fields
}
func (*Statistics) Reset ¶ added in v0.7.0
func (s *Statistics) Reset()
func (*Statistics) String ¶ added in v0.7.0
func (s *Statistics) String() string
type TypeFilter ¶
type TypeFilter struct {
// contains filtered or unexported fields
}
func NewTypeFilter ¶
func NewTypeFilter(tfs ...*TypeFunc) *TypeFilter
func (*TypeFilter) AppendTo ¶ added in v0.4.1
func (tf *TypeFilter) AppendTo(typeFunc ...*TypeFunc)
type TypeFunc ¶
TypeFunc return true -> Keep return false -> remove
func ExactFileTypeOnly ¶ added in v0.6.0
func GlobOnly ¶ added in v0.5.0
GlobOnly if all pattern complied successfully, return a func and nil error, if match any one, the fn will return true, else return false if error occurred, return nil func and error
func RemoveByExt ¶
RemoveByExt
eg: a.go b.c c.rs d.cxx dir RemoveByExt([]string{"go", "cxx"}) result: b.c c.rs dir
func RemoveExactFileType ¶ added in v0.6.0
func RemoveGitIgnore ¶ added in v0.4.1
func RemoveGitIgnore(repoPath git.GitRepoPath) TypeFunc
func RemoveGlob ¶ added in v0.5.0
RemoveGlob if all pattern complied successfully, return a func and nil error, if match any one, the fn will return false, else return false if error occurred, return nil func and error
Click to show internal directories.
Click to hide internal directories.