fpath

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplicationDir

func ApplicationDir(subdir ...string) string

ApplicationDir returns best base directory for specific OS

func EditFile

func EditFile(fileToEdit string) error

EditFile opens the best OS-specific text editor we can find

func IsRoot

func IsRoot(path string) bool

IsRoot returns whether path is the root directory

func IsValidSetupDir

func IsValidSetupDir(name string) (ok bool, err error)

IsValidSetupDir checks if directory is valid for setup configuration

func IsWritable

func IsWritable(filepath string) (bool, error)

IsWritable determines if a directory is writeable

Types

type FPath

type FPath struct {
	// contains filtered or unexported fields
}

FPath is an OS independently path handling structure

func New

func New(p string) (FPath, error)

New creates new FPath from the given URL

func (FPath) Base

func (p FPath) Base() string

Base returns the last segment of the path

func (FPath) Bucket

func (p FPath) Bucket() string

Bucket returns the first segment of path

func (FPath) IsLocal

func (p FPath) IsLocal() bool

IsLocal returns whether the path refers to local or remote location

func (FPath) Join

func (p FPath) Join(segment string) FPath

Join is appends the given segment to the path

func (FPath) Path

func (p FPath) Path() string

Path returns the URL path without the scheme

func (FPath) String

func (p FPath) String() string

String returns the entire URL (untouched)

Jump to

Keyboard shortcuts

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