validate

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package validate provides functions for validating the input configuration for the repo-slice tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateInputs

func ValidateInputs(cfg Config, fsys FS) error

ValidateInputs checks that the source and manifest paths are valid. It depends on the FS interface, not a concrete file system.

Types

type Config

type Config struct {
	ManifestPath string
	SourcePath   string
}

Config represents the input configuration that needs validation.

type FS

type FS interface {
	Stat(name string) (fs.FileInfo, error)
}

FS defines an interface for file system operations, allowing for mock implementations in tests. This adheres to the Dependency Inversion Principle.

type LiveFS

type LiveFS struct{}

LiveFS is a concrete implementation of the FS interface that uses the standard library's os package.

func (LiveFS) Stat

func (l LiveFS) Stat(name string) (fs.FileInfo, error)

Stat performs the Stat operation using the os package.

Jump to

Keyboard shortcuts

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