es_filepath

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VarDropboxPersonal           = "DropboxPersonal"
	VarDropboxBusiness           = "DropboxBusiness"
	VarDropboxBusinessOrPersonal = "DropboxBusinessOrPersonal"
	VarDropboxPersonalOrBusiness = "DropboxPersonalOrBusiness"
	VarHome                      = "Home"
	VarUsername                  = "Username"
	VarHostname                  = "Hostname"
	VarExecPath                  = "ExecPath"
	VarRand8                     = "Rand8"
	VarYear                      = "Year"
	VarMonth                     = "Month"
	VarDay                       = "Day"
	VarDate                      = "Date"
	VarTime                      = "Time"
	VarDateUTC                   = "DateUTC"
	VarTimeUTC                   = "TimeUTC"
	VarRandom                    = "Random"
)

Variables

Functions

func Escape

func Escape(p string) string

Replace chars that is not usable for path with '_'

func FormatPathWithPredefinedVariables

func FormatPathWithPredefinedVariables(path string, pairs ...Pair) (string, error)

Format path if a path contains pattern like `{{.DropboxPersonal}}`.

func IsSystemFile

func IsSystemFile(path string) bool

func Rel

func Rel(basePath, targetPath string) (rel string, err error)

Types

type FormatError

type FormatError struct {
	Reason string
	Key    string
}

func (*FormatError) Error

func (z *FormatError) Error() string

func (*FormatError) Value

func (z *FormatError) Value() string

type Pair

type Pair struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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