paths

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package paths provides common path utilities for the application.

Index

Constants

View Source
const (
	// AppDirName is the name of the application's data directory
	AppDirName = ".restclient"
)

Variables

This section is empty.

Functions

func AppDataDir

func AppDataDir(subdir string) (string, error)

AppDataDir returns the path to the application's data directory. If subdir is provided, it returns the path to that subdirectory.

func DefaultConfigPath

func DefaultConfigPath() (string, error)

DefaultConfigPath returns the path to the default config file.

func DefaultHistoryPath

func DefaultHistoryPath() (string, error)

DefaultHistoryPath returns the path to the default history file.

func DefaultLastFilePath added in v0.2.12

func DefaultLastFilePath() (string, error)

DefaultLastFilePath returns the path to the file storing the last used .http/.rest file path.

func DefaultSessionDir

func DefaultSessionDir() (string, error)

DefaultSessionDir returns the path to the default session directory.

func EnsureDir

func EnsureDir(path string) error

EnsureDir creates a directory if it doesn't exist.

func Exists

func Exists(path string) bool

Exists returns true if the path exists (file or directory).

func HomeDir

func HomeDir() (string, error)

HomeDir returns the user's home directory.

func IsDir

func IsDir(path string) bool

IsDir returns true if the path is a directory.

func IsFile

func IsFile(path string) bool

IsFile returns true if the path is a file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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