system

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrFileSystem

func NewErrFileSystem(err error, path, msg string) error

Types

type ErrFileSystem

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

func (ErrFileSystem) Error

func (e ErrFileSystem) Error() string

func (ErrFileSystem) Is

func (e ErrFileSystem) Is(target error) bool

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures a Provider.

func WithConfigCome

func WithConfigCome(configHome string) Option

WithConfigCome sets the primary config home directory of the user.

func WithFS

func WithFS(fs afero.Fs) Option

WithFS sets the file system.

func WithUserConfigDirs

func WithUserConfigDirs(configDirs []string) Option

WithUserConfigDirs sets the config directories of the user.

func WithUserContainersDir

func WithUserContainersDir(userContainersDir string) Option

WithUserContainersDir sets the data directory of the user.

func WithUserDataDir

func WithUserDataDir(userDataDir string) Option

WithUserDataDir sets the data directory of the user.

func WithUserHome added in v1.2.0

func WithUserHome(userHome string) Option

WithUserHome sets the home directory of the user.

type System

type System struct {
	Fs afero.Fs
	// contains filtered or unexported fields
}

func NewSystem

func NewSystem(options ...Option) *System

func (*System) ConfigPath

func (s *System) ConfigPath() string

func (*System) CreatePath

func (s *System) CreatePath(path string)

CreatePath returns a suitable location relative to which the file pointed by `path` can be written.

func (*System) DirExists

func (s *System) DirExists(path string) bool

func (*System) FileExists added in v1.3.0

func (s *System) FileExists(path string) bool

func (*System) HomeDir

func (s *System) HomeDir() string

func (*System) HomeEnvValue added in v1.0.0

func (s *System) HomeEnvValue() string

func (*System) IsEmpty

func (s *System) IsEmpty(path string) bool

func (*System) ReadFile

func (s *System) ReadFile(path string) []byte

func (*System) Remove

func (s *System) Remove(path string)

func (*System) RemoveAll

func (s *System) RemoveAll(path string)

func (*System) ThemesDir

func (s *System) ThemesDir() string

func (*System) UserConfigDirs

func (s *System) UserConfigDirs() []string

func (*System) UserContainerPreferences

func (s *System) UserContainerPreferences(appID string) (string, error)

func (*System) UserContainersHome

func (s *System) UserContainersHome() string

func (*System) UserDataHome

func (s *System) UserDataHome() string

func (*System) UserHome added in v1.2.0

func (s *System) UserHome() string

func (*System) WriteFile

func (s *System) WriteFile(path string, data []byte)

Jump to

Keyboard shortcuts

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