Documentation
¶
Index ¶
- func FindConfigFile(targetPath string, fileNames []string) (string, error)
- func GetConfigPath(filename string) string
- func MarshalYAML(obj any) ([]byte, error)
- func ReadFile(path string) ([]byte, error)
- func WriteDefaultFile(path string, defaultData []byte, force bool, kind string) error
- func WriteIfNotExists(path string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindConfigFile ¶
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 ¶
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 ¶
MarshalYAML serializes an object to YAML bytes.
func WriteDefaultFile ¶
WriteDefaultFile writes default content to a path. Using `force` will back up and replace any existing files.
func WriteIfNotExists ¶
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. |