dir

package
v1.8.13 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: GPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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")
	ErrNoPath = errors.New("the directory path is not set")
	ErrNoDir  = 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(sl *slog.Logger) 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