fsutil

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2026 YLD Limited SPDX-License-Identifier: Apache-2.0 Package fsutil provides filesystem utilities for parsing HCL input (files or directories), listing files by extension, and writing output files with automatic directory creation.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoHCLFiles = errors.New("no HCL files found in input")

ErrNoHCLFiles is returned when no HCL files are found in the given path.

Functions

func HasGeneratedMarker

func HasGeneratedMarker(path, provider string) (bool, error)

HasGeneratedMarker reports whether path has cinzel markers for provider.

func ListFilesWithExtensions

func ListFilesWithExtensions(path string, recursive bool, exts ...string) ([]string, error)

ListFilesWithExtensions returns files under path matching the given extensions.

func ParseHCLInput

func ParseHCLInput(path string, recursive bool) (hcl.Body, error)

ParseHCLInput parses one or more HCL files from path and returns a merged body.

func PrependGeneratedMarker

func PrependGeneratedMarker(content []byte, provider string) []byte

PrependGeneratedMarker prepends standardized cinzel generation markers.

func PruneStaleGeneratedYAML

func PruneStaleGeneratedYAML(outputDir string, currentOutputs map[string]struct{}, provider string) error

PruneStaleGeneratedYAML removes stale YAML files owned by provider.

func WriteFile

func WriteFile(path string, content []byte) error

WriteFile writes content to path, creating parent directories as needed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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