configs

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: 8 Imported by: 0

Documentation

Overview

Package configs provides the global Config configuration type for kat.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ValidKinds contains the valid kind values for global configurations.
	ValidKinds = []string{"Configuration"}

	// DefaultValidator validates global configuration against the JSON schema.
	DefaultValidator = yaml.MustNewValidator("/configs.v1beta1.json", schemaJSON)
)

Functions

func GetPath

func GetPath() string

GetPath returns the path to the global configuration file.

func WriteDefault

func WriteDefault(path string, force bool) error

WriteDefault writes the embedded default config.yaml to the specified path.

Types

type Config

type Config struct {
	Command          *command.Config `json:",inline"`
	UI               *ui.Config      `json:",inline"`
	v1beta1.TypeMeta `json:",inline"`
}

Config represents the global kat configuration.

func New

func New() *Config

New creates a new global Config with default values.

func (*Config) EnsureDefaults

func (c *Config) EnsureDefaults()

EnsureDefaults initializes nil fields to their default values.

func (Config) JSONSchemaExtend

func (c Config) JSONSchemaExtend(jss *jsonschema.Schema)

func (Config) MarshalYAML

func (c Config) MarshalYAML() ([]byte, error)

MarshalYAML serializes the config to YAML.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

func (Config) Write

func (c Config) Write(path string) error

Write writes the config to the specified path if it doesn't already exist.

Jump to

Keyboard shortcuts

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