fileinfopath

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileInfoString added in v0.5.2

func FileInfoString(fileInfo os.FileInfo) string

Types

type FilterFunc added in v0.5.2

type FilterFunc func(instance *Instance) (isTake, isBreak bool)

type HasFilterFunc added in v0.5.2

type HasFilterFunc func(index int, instance *Instance) (isSuccess bool)

type HasKeyFilterFunc added in v0.5.2

type HasKeyFilterFunc func(key string, instance *Instance) (isSuccess bool)

type Instance

type Instance struct {
	FileInfo os.FileInfo
	FullPath string
	Error    error
	// contains filtered or unexported fields
}

func New

func New(location string) *Instance

func NewUsingStat added in v0.5.2

func NewUsingStat(
	fullPath string,
	pathExistStat *chmodhelper.PathExistStat,
) *Instance

func (*Instance) AsJsonContractsBinder added in v0.5.3

func (it *Instance) AsJsonContractsBinder() corejson.JsonContractsBinder

func (*Instance) AsJsoner added in v0.5.2

func (it *Instance) AsJsoner() corejson.Jsoner

func (*Instance) BothExtension

func (it *Instance) BothExtension() (dotExt, ext string)

func (*Instance) CompareFileInfoLastModifiedDate added in v0.5.2

func (it *Instance) CompareFileInfoLastModifiedDate(right os.FileInfo) corecomparator.Compare

func (*Instance) CompareLastModified added in v0.5.1

func (it *Instance) CompareLastModified(anotherInstance *Instance) corecomparator.Compare

func (*Instance) CompareSize added in v0.5.1

func (it *Instance) CompareSize(anotherInstance *Instance) corecomparator.Compare

func (*Instance) DotExtension

func (it *Instance) DotExtension() (fileName, dotExt string)

func (*Instance) ErrorWrapper

func (it *Instance) ErrorWrapper(errType errtype.Variation) *errorwrapper.Wrapper

func (*Instance) FileName

func (it *Instance) FileName() string

FileName Returns file name with extension

func (*Instance) FileNameExt

func (it *Instance) FileNameExt() string

func (*Instance) FileNameWithoutExt

func (it *Instance) FileNameWithoutExt() string

func (*Instance) HasError

func (it *Instance) HasError() bool

func (*Instance) HasFileInfo

func (it *Instance) HasFileInfo() bool

func (*Instance) IsDir

func (it *Instance) IsDir() bool

func (*Instance) IsEmptyError

func (it *Instance) IsEmptyError() bool

func (*Instance) IsEqual added in v0.5.2

func (it *Instance) IsEqual(
	isQuickVerifyOnPathEqual,
	isPathMustMatchIfDir,
	isVerifyContent bool,
	right *Instance,
) bool

func (*Instance) IsEqualDefault added in v0.5.2

func (it *Instance) IsEqualDefault(right *Instance) bool

func (*Instance) IsExist

func (it *Instance) IsExist() bool

func (*Instance) IsFile

func (it *Instance) IsFile() bool

func (*Instance) IsInvalidFileInfo

func (it *Instance) IsInvalidFileInfo() bool

func (*Instance) IsInvalidPath

func (it *Instance) IsInvalidPath() bool

IsInvalidPath

it == nil || it.FileInfo == nil || it.Error != nil

func (*Instance) Json added in v0.5.2

func (it *Instance) Json() corejson.Result

func (Instance) JsonModelAny added in v0.5.2

func (it Instance) JsonModelAny() interface{}

func (*Instance) JsonParseSelfInject added in v0.5.3

func (it *Instance) JsonParseSelfInject(jsonResult *corejson.Result) error

func (*Instance) JsonPtr added in v0.5.2

func (it *Instance) JsonPtr() *corejson.Result

func (Instance) JsonString added in v0.5.2

func (it Instance) JsonString() string

func (*Instance) LastModifiedAt

func (it *Instance) LastModifiedAt() *time.Time

func (*Instance) Mode

func (it *Instance) Mode() os.FileMode

func (*Instance) NotDirError

func (it *Instance) NotDirError() *errorwrapper.Wrapper

func (*Instance) NotFileError

func (it *Instance) NotFileError() *errorwrapper.Wrapper

func (*Instance) Size

func (it *Instance) Size() *int64

func (*Instance) String added in v0.5.2

func (it *Instance) String() string

type InstanceCollection added in v0.5.2

type InstanceCollection struct {
	Items []*Instance `json:"Items,omitempty"`
}

func EmptyInstanceCollection added in v0.5.2

func EmptyInstanceCollection() *InstanceCollection

func NewInstanceCollection added in v0.5.2

func NewInstanceCollection(capacity int) *InstanceCollection

func NewInstanceCollectionUsingFilePathsAsync added in v0.5.2

func NewInstanceCollectionUsingFilePathsAsync(
	filePaths ...string,
) *InstanceCollection

func NewInstanceCollectionUsingInstanceItems added in v0.5.2

func NewInstanceCollectionUsingInstanceItems(
	infoItems ...*Instance,
) *InstanceCollection

func (*InstanceCollection) Add added in v0.5.2

func (it *InstanceCollection) Add(
	instanceItem *Instance,
) *InstanceCollection

func (*InstanceCollection) AddDirsPtr added in v0.5.2

func (it *InstanceCollection) AddDirsPtr(
	isSkipOnIssues bool,
	infoItems ...*Instance,
) *InstanceCollection

func (*InstanceCollection) AddFilesPtr added in v0.5.2

func (it *InstanceCollection) AddFilesPtr(
	isSkipOnIssues bool,
	infoItems ...*Instance,
) *InstanceCollection

func (*InstanceCollection) Adds added in v0.5.2

func (it *InstanceCollection) Adds(
	infoItems ...*Instance,
) *InstanceCollection

func (*InstanceCollection) AddsIf added in v0.5.2

func (it *InstanceCollection) AddsIf(
	isAdd bool,
	infoItems ...*Instance,
) *InstanceCollection

func (*InstanceCollection) AddsPtr added in v0.5.2

func (it *InstanceCollection) AddsPtr(
	isSkipOnIssues bool,
	instanceItems ...*Instance,
) *InstanceCollection

func (*InstanceCollection) AllFileInfos added in v0.5.2

func (it *InstanceCollection) AllFileInfos() []*Instance

func (*InstanceCollection) AllFilePathToInstanceMap added in v0.5.2

func (it *InstanceCollection) AllFilePathToInstanceMap() map[string]*Instance

AllFilePathToInstanceMap

Key = filePath,

Value = Instance

func (*InstanceCollection) AllFilePaths added in v0.5.2

func (it *InstanceCollection) AllFilePaths() []string

func (*InstanceCollection) AllFilePathsSorted added in v0.5.2

func (it *InstanceCollection) AllFilePathsSorted() []string

func (*InstanceCollection) AsJsonContractsBinder added in v0.5.3

func (it *InstanceCollection) AsJsonContractsBinder() corejson.JsonContractsBinder

func (*InstanceCollection) AsJsonParseSelfInjector added in v0.5.2

func (it *InstanceCollection) AsJsonParseSelfInjector() corejson.JsonParseSelfInjector

func (*InstanceCollection) AsJsoner added in v0.5.2

func (it *InstanceCollection) AsJsoner() corejson.Jsoner

func (*InstanceCollection) CleanupNonNull added in v0.5.2

func (it *InstanceCollection) CleanupNonNull() *InstanceCollection

func (*InstanceCollection) Clear added in v0.5.2

func (InstanceCollection) Clone added in v0.5.2

func (*InstanceCollection) ClonePtr added in v0.5.2

func (it *InstanceCollection) ClonePtr() *InstanceCollection

func (*InstanceCollection) ConcatNew added in v0.5.2

func (it *InstanceCollection) ConcatNew(
	additionalInstanceItems ...*Instance,
) *InstanceCollection

func (*InstanceCollection) ConcatNewPtr added in v0.5.2

func (it *InstanceCollection) ConcatNewPtr(
	additionalInstanceItems ...*Instance,
) *InstanceCollection

func (*InstanceCollection) Count added in v0.5.2

func (it *InstanceCollection) Count() int

func (*InstanceCollection) CsvStrings added in v0.5.2

func (it *InstanceCollection) CsvStrings() []string

func (*InstanceCollection) Dispose added in v0.5.2

func (it *InstanceCollection) Dispose()

func (*InstanceCollection) Filter added in v0.5.2

func (it *InstanceCollection) Filter(
	filterFunc FilterFunc,
) []*Instance

func (*InstanceCollection) FilterExtInstanceCollection added in v0.5.2

func (it *InstanceCollection) FilterExtInstanceCollection(
	dotExtension string,
) *InstanceCollection

func (*InstanceCollection) FilterInstanceCollection added in v0.5.2

func (it *InstanceCollection) FilterInstanceCollection(
	filterFunc FilterFunc,
) *InstanceCollection

func (*InstanceCollection) FilterWithLimit added in v0.5.2

func (it *InstanceCollection) FilterWithLimit(
	limit int,
	filterFunc FilterFunc,
) []*Instance

func (*InstanceCollection) First added in v0.5.2

func (it *InstanceCollection) First() *Instance

func (*InstanceCollection) FirstDynamic added in v0.5.2

func (it *InstanceCollection) FirstDynamic() interface{}

func (*InstanceCollection) FirstOrDefault added in v0.5.2

func (it *InstanceCollection) FirstOrDefault() *Instance

func (*InstanceCollection) FirstOrDefaultDynamic added in v0.5.2

func (it *InstanceCollection) FirstOrDefaultDynamic() interface{}

func (*InstanceCollection) GetPagedCollection added in v0.5.2

func (it *InstanceCollection) GetPagedCollection(
	eachPageSize int,
) []*InstanceCollection

func (*InstanceCollection) GetPagesSize added in v0.5.2

func (it *InstanceCollection) GetPagesSize(
	eachPageSize int,
) int

func (*InstanceCollection) GetSinglePageCollection added in v0.5.2

func (it *InstanceCollection) GetSinglePageCollection(
	eachPageSize int,
	pageIndex int,
) *InstanceCollection

GetSinglePageCollection PageIndex is one based index. Should be above or equal 1

func (*InstanceCollection) HasAnyItem added in v0.5.2

func (it *InstanceCollection) HasAnyItem() bool

func (*InstanceCollection) HasFilterFuncAsync added in v0.5.2

func (it *InstanceCollection) HasFilterFuncAsync(
	hasFilterFunc HasFilterFunc,
) (isSuccess bool)

func (*InstanceCollection) HasIndex added in v0.5.2

func (it *InstanceCollection) HasIndex(index int) bool

func (*InstanceCollection) InsertAt added in v0.5.2

func (it *InstanceCollection) InsertAt(index int, item *Instance) *InstanceCollection

func (*InstanceCollection) IsEmpty added in v0.5.2

func (it *InstanceCollection) IsEmpty() bool

func (*InstanceCollection) IsEqual added in v0.5.2

func (it *InstanceCollection) IsEqual(
	isQuickVerifyOnPathEqual,
	isPathMustMatchIfDir,
	isVerifyContent bool,
	another *InstanceCollection,
) bool

func (*InstanceCollection) IsEqualDefault added in v0.5.2

func (it *InstanceCollection) IsEqualDefault(
	another *InstanceCollection,
) bool

func (*InstanceCollection) IsEqualItems added in v0.5.2

func (it *InstanceCollection) IsEqualItems(
	isQuickVerifyOnPathEqual,
	isPathMustMatchIfDir,
	isVerifyContent bool,
	lines ...*Instance,
) bool

func (*InstanceCollection) Join added in v0.5.2

func (it *InstanceCollection) Join(joiner string) string

func (*InstanceCollection) JoinCsv added in v0.5.2

func (it *InstanceCollection) JoinCsv() string

func (*InstanceCollection) JoinCsvLine added in v0.5.2

func (it *InstanceCollection) JoinCsvLine() string

func (*InstanceCollection) JoinJsonStrings added in v0.5.2

func (it *InstanceCollection) JoinJsonStrings(joiner string) string

func (*InstanceCollection) JoinLine added in v0.5.2

func (it *InstanceCollection) JoinLine() string

func (InstanceCollection) Json added in v0.5.2

func (*InstanceCollection) JsonModel added in v0.5.2

func (it *InstanceCollection) JsonModel() []*Instance

func (*InstanceCollection) JsonModelAny added in v0.5.2

func (it *InstanceCollection) JsonModelAny() interface{}

func (*InstanceCollection) JsonParseSelfInject added in v0.5.2

func (it *InstanceCollection) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (InstanceCollection) JsonPtr added in v0.5.2

func (it InstanceCollection) JsonPtr() *corejson.Result

func (*InstanceCollection) JsonString added in v0.5.2

func (it *InstanceCollection) JsonString() string

func (*InstanceCollection) JsonStrings added in v0.5.2

func (it *InstanceCollection) JsonStrings() []string

func (*InstanceCollection) KeyStringMapUsingFmtFunc added in v0.5.3

func (it *InstanceCollection) KeyStringMapUsingFmtFunc(
	fmtFunc MapKeyStringValueInstanceFmtFunc,
) map[string]*Instance

func (*InstanceCollection) KeyValueStringMapUsingFmtFunc added in v0.5.3

func (it *InstanceCollection) KeyValueStringMapUsingFmtFunc(
	fmtFunc MapKeyValueStringFmtFunc,
) map[string]string

func (*InstanceCollection) Last added in v0.5.2

func (it *InstanceCollection) Last() *Instance

func (*InstanceCollection) LastDynamic added in v0.5.2

func (it *InstanceCollection) LastDynamic() interface{}

func (*InstanceCollection) LastIndex added in v0.5.2

func (it *InstanceCollection) LastIndex() int

func (*InstanceCollection) LastOrDefault added in v0.5.2

func (it *InstanceCollection) LastOrDefault() *Instance

func (*InstanceCollection) LastOrDefaultDynamic added in v0.5.2

func (it *InstanceCollection) LastOrDefaultDynamic() interface{}

func (*InstanceCollection) Length added in v0.5.2

func (it *InstanceCollection) Length() int

func (*InstanceCollection) Limit added in v0.5.2

func (it *InstanceCollection) Limit(limit int) []*Instance

func (*InstanceCollection) LimitCollection added in v0.5.2

func (it *InstanceCollection) LimitCollection(limit int) *InstanceCollection

func (*InstanceCollection) LimitDynamic added in v0.5.2

func (it *InstanceCollection) LimitDynamic(limit int) interface{}

func (*InstanceCollection) ParseInjectUsingJson added in v0.5.2

func (it *InstanceCollection) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*InstanceCollection, error)

func (*InstanceCollection) ParseInjectUsingJsonMust added in v0.5.2

func (it *InstanceCollection) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *InstanceCollection

ParseInjectUsingJsonMust Panic if error

func (*InstanceCollection) Reverse added in v0.5.2

func (it *InstanceCollection) Reverse() *InstanceCollection

func (*InstanceCollection) SafeLimitCollection added in v0.5.2

func (it *InstanceCollection) SafeLimitCollection(limit int) *InstanceCollection

func (*InstanceCollection) Skip added in v0.5.2

func (it *InstanceCollection) Skip(skippingItemsCount int) []*Instance

func (*InstanceCollection) SkipCollection added in v0.5.2

func (it *InstanceCollection) SkipCollection(skippingItemsCount int) *InstanceCollection

func (*InstanceCollection) SkipDynamic added in v0.5.2

func (it *InstanceCollection) SkipDynamic(skippingItemsCount int) interface{}

func (InstanceCollection) String added in v0.5.2

func (it InstanceCollection) String() string

func (*InstanceCollection) Strings added in v0.5.2

func (it *InstanceCollection) Strings() []string

func (*InstanceCollection) StringsUsingStringerFmtFunc added in v0.5.2

func (it *InstanceCollection) StringsUsingStringerFmtFunc(
	fmtFunc StringerFmtFunc,
) []string

func (*InstanceCollection) Take added in v0.5.2

func (it *InstanceCollection) Take(takeDynamicItems int) []*Instance

func (*InstanceCollection) TakeAllFilter added in v0.5.2

func (it *InstanceCollection) TakeAllFilter(
	limit int,
	filterFunc TakeAllFilterFunc,
) []*Instance

func (*InstanceCollection) TakeAllFilterCollection added in v0.5.2

func (it *InstanceCollection) TakeAllFilterCollection(
	limit int,
	filterFunc TakeAllFilterFunc,
) *InstanceCollection

func (*InstanceCollection) TakeCollection added in v0.5.2

func (it *InstanceCollection) TakeCollection(takeDynamicItems int) *InstanceCollection

func (*InstanceCollection) TakeDynamic added in v0.5.2

func (it *InstanceCollection) TakeDynamic(takeDynamicItems int) interface{}

type MapKeyStringValueInstanceFmtFunc added in v0.5.3

type MapKeyStringValueInstanceFmtFunc func(instance *Instance) (key string)

type MapKeyValueStringFmtFunc added in v0.5.3

type MapKeyValueStringFmtFunc func(instance *Instance) (key, value string)

type StringerFmtFunc added in v0.5.2

type StringerFmtFunc func(index int, instance *Instance) string

type TakeAllFilterFunc added in v0.5.2

type TakeAllFilterFunc func(instance *Instance) (isTake bool)

Jump to

Keyboard shortcuts

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