defaults

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package defaults provides functionality for managing default values and configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string, embeds config.Embedded, cfg config.Config) (tools.Defaults, error)

Load loads the default configuration.

Types

type Defaults

type Defaults struct {
	// contains filtered or unexported fields
}

Defaults holds all the configuration options for godyl, including tool-specific defaults.

func (*Defaults) Default

func (d *Defaults) Default(defaults []byte) error

Default loads the embedded default YAML configuration.

func (*Defaults) FromFile

func (d *Defaults) FromFile(path string) error

FromFile reads and parses a YAML file from the given path into the Defaults struct.

func (*Defaults) Load

func (d *Defaults) Load(path string, defaults []byte) error

Load loads configuration defaults from a file or uses embedded defaults if not specified.

func (*Defaults) Merge

func (d *Defaults) Merge(cfg config.Config) error

Merge applies configuration overrides to the defaults.

func (*Defaults) Unmarshal

func (d *Defaults) Unmarshal(data []byte) error

Unmarshal parses the provided YAML data into the Defaults struct.

func (*Defaults) Validate

func (d *Defaults) Validate() error

Validate checks the Defaults struct to ensure all required fields are properly set.

Jump to

Keyboard shortcuts

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