file

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// File permissions
	DirPerms  = 0755
	FilePerms = 0600
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct{}

func NewHandler

func NewHandler() *Handler

func (*Handler) AppendKeyToContent

func (h *Handler) AppendKeyToContent(content, key, value string) string

func (*Handler) CreateDirectory

func (h *Handler) CreateDirectory(path string) error
func (h *Handler) CreateSymlink(target, link string) error

func (*Handler) EnsureDirectory

func (h *Handler) EnsureDirectory(path string) error

Directory operations

func (*Handler) FileExists

func (h *Handler) FileExists(path string) bool

func (*Handler) FindKeyInContent

func (h *Handler) FindKeyInContent(content, key string) (int, bool)

func (*Handler) GetAbsolutePath

func (h *Handler) GetAbsolutePath(path string) (string, error)

func (*Handler) GetDirectory

func (h *Handler) GetDirectory(path string) string

func (*Handler) GetFilePath

func (h *Handler) GetFilePath(basePath, filename string) (string, error)

func (*Handler) GetProjectPath

func (h *Handler) GetProjectPath(projectDir string) (string, error)

Generic path builders

func (*Handler) GetRelativePath

func (h *Handler) GetRelativePath(base, target string) (string, error)

func (*Handler) GetSubPath

func (h *Handler) GetSubPath(basePath, subDir string) (string, error)

func (*Handler) GetWorkingDirectory

func (h *Handler) GetWorkingDirectory() (string, error)

func (*Handler) JoinPaths

func (h *Handler) JoinPaths(paths ...string) string

func (*Handler) ReadFile

func (h *Handler) ReadFile(path string) (string, error)

File operations

func (h *Handler) ReadSymlink(link string) (string, error)

func (*Handler) RemoveFile

func (h *Handler) RemoveFile(path string) error

func (*Handler) UpdateKeyInContent

func (h *Handler) UpdateKeyInContent(content, key, value string, keyIndex int) string

func (*Handler) WriteFile

func (h *Handler) WriteFile(path, content string) error

Jump to

Keyboard shortcuts

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