linker

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupEmptyDirs added in v1.1.0

func CleanupEmptyDirs(basePath string)

CleanupEmptyDirs removes all empty directories under the given path. It iterates until no more empty directories are found, handling nested empties. The basePath itself is never removed.

Types

type CopyLinker

type CopyLinker struct{}

CopyLinker deploys mods by copying files

func NewCopy

func NewCopy() *CopyLinker

NewCopy creates a new copy linker

func (*CopyLinker) Deploy

func (l *CopyLinker) Deploy(src, dst string) (err error)

Deploy copies src to dst

func (*CopyLinker) IsDeployed

func (l *CopyLinker) IsDeployed(dst string) (bool, error)

IsDeployed checks if dst exists

func (*CopyLinker) Method

func (l *CopyLinker) Method() domain.LinkMethod

Method returns the link method

func (*CopyLinker) Undeploy

func (l *CopyLinker) Undeploy(dst string) error

Undeploy removes the file at dst

type HardlinkLinker

type HardlinkLinker struct{}

HardlinkLinker deploys mods using hard links

func NewHardlink() *HardlinkLinker

NewHardlink creates a new hardlink linker

func (*HardlinkLinker) Deploy

func (l *HardlinkLinker) Deploy(src, dst string) error

Deploy creates a hard link from src to dst

func (*HardlinkLinker) IsDeployed

func (l *HardlinkLinker) IsDeployed(dst string) (bool, error)

IsDeployed checks if dst exists (hardlinks are indistinguishable from regular files)

func (*HardlinkLinker) Method

func (l *HardlinkLinker) Method() domain.LinkMethod

Method returns the link method

func (*HardlinkLinker) Undeploy

func (l *HardlinkLinker) Undeploy(dst string) error

Undeploy removes the file at dst

type Linker

type Linker interface {
	Deploy(src, dst string) error
	Undeploy(dst string) error
	IsDeployed(dst string) (bool, error)
	Method() domain.LinkMethod
}

Linker deploys and undeploys mod files to game directories

func New

func New(method domain.LinkMethod) Linker

New creates a linker for the given method

type SymlinkLinker

type SymlinkLinker struct{}

SymlinkLinker deploys mods using symbolic links

func NewSymlink() *SymlinkLinker

NewSymlink creates a new symlink linker

func (*SymlinkLinker) Deploy

func (l *SymlinkLinker) Deploy(src, dst string) error

Deploy creates a symlink from src to dst

func (*SymlinkLinker) IsDeployed

func (l *SymlinkLinker) IsDeployed(dst string) (bool, error)

IsDeployed checks if dst is a symlink

func (*SymlinkLinker) Method

func (l *SymlinkLinker) Method() domain.LinkMethod

Method returns the link method

func (*SymlinkLinker) Undeploy

func (l *SymlinkLinker) Undeploy(dst string) error

Undeploy removes the symlink at dst

Jump to

Keyboard shortcuts

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