types

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package types defines the core types and interfaces used throughout dodot. This includes interfaces for Handler and Action, as well as data structures like Pack and RuleMatch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS added in v0.1.4

type FS interface {
	// File operations
	Stat(name string) (fs.FileInfo, error)
	ReadFile(name string) ([]byte, error)
	WriteFile(name string, data []byte, perm fs.FileMode) error

	// Directory operations
	MkdirAll(path string, perm fs.FileMode) error
	ReadDir(name string) ([]fs.DirEntry, error)

	// Symlink operations
	Symlink(oldname, newname string) error
	Readlink(name string) (string, error)

	// Other operations
	Remove(name string) error
	RemoveAll(path string) error
	Rename(oldpath, newpath string) error

	// Optional operations - implementations should check for support
	// For testing, Lstat can fall back to Stat
	Lstat(name string) (fs.FileInfo, error)
}

FS is the filesystem interface required for dodot operations

type Pack

type Pack struct {
	// Name is the pack name (usually the directory name)
	Name string

	// Path is the absolute path to the pack directory
	Path string

	// Config contains pack-specific configuration from .dodot.toml
	Config config.PackConfig

	// Metadata contains any additional pack information
	Metadata map[string]interface{}
}

Pack represents a directory containing dotfiles and configuration

func (*Pack) GetFilePath added in v0.2.0

func (p *Pack) GetFilePath(filename string) string

GetFilePath returns the full path to a file within the pack This is a fundamental method that computes paths based on the pack's location

type Pather added in v0.1.4

type Pather interface {
	// DotfilesRoot returns the root directory for dotfiles
	DotfilesRoot() string

	// DataDir returns the XDG data directory for dodot
	DataDir() string

	// ConfigDir returns the XDG config directory for dodot
	ConfigDir() string

	// CacheDir returns the XDG cache directory for dodot
	CacheDir() string

	// StateDir returns the XDG state directory for dodot
	StateDir() string
}

Pather provides paths for dodot operations

Jump to

Keyboard shortcuts

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