files

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateServiceName added in v1.6.1

func ValidateServiceName(name string) error

ValidateServiceName rejects names that could escape the intended directories when joined into file paths (path traversal via "/" or "..") or are otherwise malformed. The allowed set mirrors the deploy-time validation: letters, digits, '-' and '_'. Undeploy did not validate the control-plane-supplied name before filepath.Join'ing it into os.Remove targets, so a name like "../../etc/foo" could delete files outside the managed directories.

func WriteBootstrapFile

func WriteBootstrapFile(filename string, content []byte) (string, error)

func WriteDummyNetplanFile

func WriteDummyNetplanFile(ifaceName, downstreamAddress string, port uint32) (string, error)

func WriteSystemdServiceFile

func WriteSystemdServiceFile(filename, name, version string, port uint32) (string, error)

Types

type DeleteFilesResult

type DeleteFilesResult struct {
	DeletedFiles []string
	Errors       []error
}

func DeleteFiles

func DeleteFiles(filePaths []string, log *logger.Logger) DeleteFilesResult

func DeleteServiceFiles

func DeleteServiceFiles(name string, port uint32, ifaceName string, log *logger.Logger) DeleteFilesResult

Jump to

Keyboard shortcuts

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