dir

package
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package dir handles the directories in use by the internal server. Such as the download, extra, and preview directories.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFile = errors.New("file error")
	ErrSave = errors.New("save error")
	ErrDir  = errors.New("the directory path is not set")
	ErrNF   = errors.New("the directory path does not exist")
)

Functions

func Paths

func Paths(d ...Directory) []string

Paths converts the slice of Directory types to a slice of strings representing the directory paths.

Types

type Directory

type Directory string

Directory is a string type that represents an internal server directory path.

func (Directory) Check

func (d Directory) Check() error

Check confirms that the directory exists and is writable.

func (Directory) IsDir

func (d Directory) IsDir() error

IsDir returns an error if the path does not exists or is not a directory.

func (Directory) Join

func (d Directory) Join(name string) string

Join combines the directory path with the given file or directory name.

func (Directory) Path

func (d Directory) Path() string

Path returns the directory path as a string.

Jump to

Keyboard shortcuts

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