paths

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirExists

func DirExists(path string) bool

DirExists checks for the existence of a directory.

func Exists

func Exists(path string) (bool, bool)

Exists checks for the existence of a file or directory. The second return value is true if it's a directory.

func FileExists

func FileExists(path string) bool

FileExists checks for the existence of a file.

Types

type Paths

type Paths struct {
	// AppName is used to build the config paths.
	AppName string
	// UserBase is the base path for user apps.
	UserBase string
	// ServerBase is the base path for server apps.
	ServerBase string
}

Paths holds OS-specific paths for data.

func New

func New(appname string) (*Paths, error)

New returns a Paths struct.

func (*Paths) SetBase

func (cp *Paths) SetBase(s string) error

SetBase to something different than the default.

func (*Paths) SetServerBase

func (cp *Paths) SetServerBase(s string) error

SetServerBase to something different than the default.

Jump to

Keyboard shortcuts

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