pathfixer

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fix added in v0.3.8

func Fix(isExpand bool, path string) string

func FixIf added in v0.3.8

func FixIf(isNormalize, isExpand bool, path string) string

func FixMany added in v0.3.8

func FixMany(isExpand bool, paths ...string) []string

Types

type Location

type Location struct {
	PathOptions
	Path string `json:"Location,omitempty"` // empty path will be ignored from applying, must use CompiledPath
	// contains filtered or unexported fields
}

Location Don't use Path Directly but use CompiledPath

func NewLocation added in v0.2.8

func NewLocation(location string) *Location

func NewLocationUsingOptions added in v0.2.8

func NewLocationUsingOptions(
	location string,
	options PathOptions,
) *Location

func (*Location) ClonePath

func (it *Location) ClonePath() *Location

func (*Location) CompiledPath

func (it *Location) CompiledPath() string

func (*Location) ExistStat added in v0.3.8

func (it *Location) ExistStat() *chmodhelper.PathExistStat

func (*Location) FileInfo added in v0.3.8

func (it *Location) FileInfo() os.FileInfo

func (*Location) FileMode added in v0.3.8

func (it *Location) FileMode() os.FileMode

func (*Location) HasPath

func (it *Location) HasPath() bool

func (*Location) IsDir added in v0.3.8

func (it *Location) IsDir() bool

func (*Location) IsEmptyPath

func (it *Location) IsEmptyPath() bool

func (*Location) IsEqual added in v0.3.5

func (it *Location) IsEqual(another *Location) bool

func (*Location) IsEqualWithoutOptions added in v0.3.5

func (it *Location) IsEqualWithoutOptions(another *Location) bool

func (*Location) IsExistButDir added in v0.3.8

func (it *Location) IsExistButDir() bool

func (*Location) IsExistButFile added in v0.3.8

func (it *Location) IsExistButFile() bool

func (*Location) IsFile added in v0.3.8

func (it *Location) IsFile() bool

func (*Location) IsInvalid added in v0.3.8

func (it *Location) IsInvalid() bool

func (*Location) IsInvalidPath added in v0.3.8

func (it *Location) IsInvalidPath() bool

func (*Location) IsPathExist

func (it *Location) IsPathExist() bool

IsPathExist returns true if exist on the file system

func (*Location) LastModifiedAt added in v0.4.2

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

func (*Location) SafeFileMode added in v0.3.8

func (it *Location) SafeFileMode() os.FileMode

func (*Location) Size added in v0.4.2

func (it *Location) Size() *int64

type PathOptions

type PathOptions struct {
	IsContinueOnError bool `json:"IsContinueOnError,omitempty"`
	IsNormalize       bool `json:"IsNormalize,omitempty"`
	IsExpandEnvVar    bool `json:"IsExpandEnvVar,omitempty"` // can expand environment variables with %{Name} $Name %{Java_home} ${Java_HOME}
	IsRecursive       bool `json:"IsRecursive,omitempty"`
	IsSkipOnInvalid   bool `json:"IsSkipOnInvalid,omitempty"`
	IsSkipOnExist     bool `json:"IsSkipOnExist,omitempty"`
	IsSkipOnEmpty     bool `json:"IsSkipOnEmpty,omitempty"`
	IsRelative        bool `json:"IsRelative,omitempty"`
}

func (*PathOptions) ClonePathOptions

func (it *PathOptions) ClonePathOptions() *PathOptions

func (*PathOptions) GetFixedPath

func (it *PathOptions) GetFixedPath(location string) string

func (*PathOptions) GetFixedPathJoined

func (it *PathOptions) GetFixedPathJoined(location1, location2 string) string

func (*PathOptions) GetFixedPathJoinedMany

func (it *PathOptions) GetFixedPathJoinedMany(
	locations ...string,
) string

func (*PathOptions) IsEqual added in v0.3.5

func (it *PathOptions) IsEqual(another *PathOptions) bool

func (*PathOptions) Join added in v0.3.5

func (it *PathOptions) Join(location1, location2 string) string

Jump to

Keyboard shortcuts

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