path_helpers

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 13 Imported by: 75

README

path-helpes

Path Helpers functions.

Get it

go get github.com/moisespsena-go/path-helpers

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GOPATHS []*goPath
)

Functions

func CleanModVersion added in v0.0.2

func CleanModVersion(pth string) string

CleanModVersion clean mod version sufix `@vX.X.X-DATE-COMMIT_ID`

func CopyTree

func CopyTree(dest string, sources []interface{}) (err error)

func GetCalledDir

func GetCalledDir(abs ...bool) string

func GetCalledDirUp

func GetCalledDirUp(up int, abs ...bool) string

func GetCalledFile

func GetCalledFile(abs ...bool) string

func GetCalledFileAbs

func GetCalledFileAbs(skip ...int) string

func GetCalledFileUp

func GetCalledFileUp(up int, abs ...bool) string

func HasSources

func HasSources(skip ...int) bool

func IsExistingDir

func IsExistingDir(pth string) bool

func IsExistingDirE

func IsExistingDirE(pth string) (ok bool, err error)

func IsExistingRegularFile

func IsExistingRegularFile(pth string) bool
func IsSymlink(mode os.FileMode) bool

func MkdirAll

func MkdirAll(pth string) error

func MkdirAllIfNotExists

func MkdirAllIfNotExists(pth string) error

func MkdirAllIfNotExistsPerms added in v0.0.3

func MkdirAllIfNotExistsPerms(pth string, perms permbits.PermissionBits) error

func MustResolveFileMode

func MustResolveFileMode(pth string) os.FileMode

func MustResolveMode

func MustResolveMode(pth string) os.FileMode

func Parents

func Parents(sub, sep string, cb func(sub string) error) (err error)

func PkgFromPath

func PkgFromPath(pth string) string

func PkgPathOf

func PkgPathOf(value interface{}) string

func ResolveFileMode

func ResolveFileMode(pth string) (mode os.FileMode, err error)

func ResolveFilePerms

func ResolveFilePerms(pth string) (perms permbits.PermissionBits, err error)

func ResolveMode

func ResolveMode(pth string) (mode os.FileMode, err error)

func ResolvePerms

func ResolvePerms(pth string) (perms permbits.PermissionBits, err error)

func StripGoPath

func StripGoPath(parts ...string) string

Types

type GoPath

type GoPath interface {
	Pth() string
	HasSrcDir() bool
}

func ResolveGoPath

func ResolveGoPath(pth string) (gopath GoPath)

func ResolveGoSrcPath

func ResolveGoSrcPath(p ...string) (gpth GoPath, pth string)

type Path

type Path struct {
	Real  string
	Alias string
	Data  []byte
}

Jump to

Keyboard shortcuts

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