filetype

package
v1.179.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFailedToProcessHclFile = errors.New("failed to process HCL file")

Functions

func DetectFormatAndParseFile

func DetectFormatAndParseFile(readFileFunc func(string) ([]byte, error), filename string) (any, error)

DetectFormatAndParseFile detects the format of the file (JSON, YAML, HCL) and parses the file into a Go type. For all other formats, it just reads the file and returns the content as a string.

func IsHCL

func IsHCL(data string) bool

IsHCL checks if data is in HCL format.

func IsJSON

func IsJSON(data string) bool

IsJSON checks if data is in JSON format.

func IsYAML

func IsYAML(data string) bool

IsYAML checks if data is in YAML format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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