dfpath

package
v2.1.12 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultWorkHome               = "/usr/local/dragonfly"
	DefaultWorkHomeMode           = os.FileMode(0700)
	DefaultCacheDir               = "/var/cache/dragonfly"
	DefaultCacheDirMode           = os.FileMode(0700)
	DefaultConfigDir              = "/etc/dragonfly"
	DefaultLogDir                 = "/var/log/dragonfly"
	DefaultDataDir                = "/var/lib/dragonfly"
	DefaultDataDirMode            = os.FileMode(0700)
	DefaultPluginDir              = "/usr/local/dragonfly/plugins"
	DefaultDownloadUnixSocketPath = "/var/run/dfdaemon.sock"
)

Functions

This section is empty.

Types

type Dfpath

type Dfpath interface {
	WorkHome() string
	WorkHomeMode() fs.FileMode
	CacheDir() string
	CacheDirMode() fs.FileMode
	LogDir() string
	DataDir() string
	DataDirMode() fs.FileMode
	PluginDir() string
	DaemonSockPath() string
	DaemonLockPath() string
	DfgetLockPath() string
}

Dfpath is the interface used for init project path.

func New

func New(options ...Option) (Dfpath, error)

New returns a new dfpath interface.

type Option

type Option func(d *dfpath)

Option is a functional option for configuring the dfpath.

func WithCacheDir

func WithCacheDir(dir string) Option

WithCacheDir set the cache directory.

func WithCacheDirMode added in v2.0.30

func WithCacheDirMode(mode fs.FileMode) Option

WithCacheDirMode sets the cacheDir mode

func WithDataDir

func WithDataDir(dir string) Option

WithDataDir set download data directory.

func WithDataDirMode added in v2.0.30

func WithDataDirMode(mode fs.FileMode) Option

WithDataDirMode sets the dataDir mode

func WithDownloadUnixSocketPath added in v2.0.6

func WithDownloadUnixSocketPath(path string) Option

WithDownloadUnixSocketPath set unix socket path.

func WithLogDir

func WithLogDir(dir string) Option

WithLogDir set the log directory.

func WithPluginDir added in v2.0.5

func WithPluginDir(dir string) Option

WithPluginDir set plugin directory.

func WithWorkHome

func WithWorkHome(dir string) Option

WithWorkHome set the workhome directory.

func WithWorkHomeMode added in v2.0.30

func WithWorkHomeMode(mode fs.FileMode) Option

WithWorkHomeMode sets the workHome directory mode

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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