api

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConfigFile

func FindConfigFile(targetPath string, fileNames []string) (string, error)

FindConfigFile searches for a config file starting from targetPath and walking up the directory tree until the filesystem root. It checks for all provided fileNames in each directory. Returns the path to the config file if found, or empty string if not found.

func GetConfigPath

func GetConfigPath(filename string) string

GetConfigPath returns the path to a configuration file in the user's config directory. It checks $XDG_CONFIG_HOME first, then falls back to ~/.config, and finally to a temp directory.

func MarshalYAML

func MarshalYAML(obj any) ([]byte, error)

MarshalYAML serializes an object to YAML bytes.

func ReadFile

func ReadFile(path string) ([]byte, error)

ReadFile reads a file from disk with proper error handling.

func WriteDefaultFile

func WriteDefaultFile(path string, defaultData []byte, force bool, kind string) error

WriteDefaultFile writes default content to a path. Using `force` will back up and replace any existing files.

func WriteIfNotExists

func WriteIfNotExists(path string, data []byte) error

WriteIfNotExists writes data to a path if the file doesn't already exist.

Types

This section is empty.

Directories

Path Synopsis
Package v1beta1 contains the v1beta1 API types for kat configuration.
Package v1beta1 contains the v1beta1 API types for kat configuration.
configs
Package configs provides the global Config configuration type for kat.
Package configs provides the global Config configuration type for kat.
policies
Package policies provides the Policy configuration type for kat.
Package policies provides the Policy configuration type for kat.
runtimeconfigs
Package runtimeconfigs provides the RuntimeConfig configuration type for kat.
Package runtimeconfigs provides the RuntimeConfig configuration type for kat.

Jump to

Keyboard shortcuts

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