fpath

package
v0.25.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: AGPL-3.0 Imports: 12 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 GetTempData added in v0.12.0

func GetTempData(ctx context.Context) (string, bool, bool)

GetTempData returns if temporary data should be stored in memory or on disk

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

func WithTempData added in v0.12.0

func WithTempData(ctx context.Context, directory string, inmemory bool) context.Context

WithTempData creates context with information how store temporary data, in memory or on disk

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