Documentation
¶
Index ¶
- func CountYamlListItems(data []byte) (int, error)
- func GetInherits(data []byte, defaultInherit string, length int) ([]inherit.Inherit, error)
- func LoadDotEnv(path file.File) error
- func LoadTools(path file.File, defaults *defaults.Defaults, defaultConfig string) (tools.Tools, error)
- func ParseBytes(yamlBytes []byte) any
- func Print(format string, cfg ...any)
- func SplitTags(tagList []string) tags.IncludeTags
- type Inherits
- type ToolsLoader
- func (t *ToolsLoader) Length() int
- func (t *ToolsLoader) Load(defaultConfig string) error
- func (t *ToolsLoader) Read() (data []byte, err error)
- func (t *ToolsLoader) Type() (Type, error)
- func (t *ToolsLoader) UnmarshalPieceByPiece(data []byte) (err error)
- func (t *ToolsLoader) UnmarshalWhole(data []byte) (err error)
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountYamlListItems ¶ added in v0.0.11
CountYamlListItems counts the number of items in a YAML list.
func GetInherits ¶ added in v0.0.11
func LoadDotEnv ¶
LoadFromDotEnv loads environment variables from a .env file.
func LoadTools ¶
func LoadTools(path file.File, defaults *defaults.Defaults, defaultConfig string) (tools.Tools, error)
LoadTools loads the tools configuration from the specified file path, or from stdin if the path is "-". It returns a Tools collection, initialized with the provided defaults.
func ParseBytes ¶ added in v0.0.11
ParseBytes parses YAML bytes into a generic data structure.
func SplitTags ¶
func SplitTags(tagList []string) tags.IncludeTags
Split splits tags into include and exclude lists.
Types ¶
type ToolsLoader ¶
type ToolsLoader struct {
// File represents the file path to the tools configuration.
File file.File
// Defaults represents the default tool configuration.
Defaults *defaults.Defaults
// contains filtered or unexported fields
}
ToolsLoader is a struct that handles loading tools configuration.
func (*ToolsLoader) Length ¶ added in v0.0.11
func (t *ToolsLoader) Length() int
func (*ToolsLoader) Load ¶ added in v0.0.11
func (t *ToolsLoader) Load(defaultConfig string) error
LoadTools loads the tools configuration.
func (*ToolsLoader) Read ¶ added in v0.0.11
func (t *ToolsLoader) Read() (data []byte, err error)
Read reads a tool configuration file and loads it into the a Tools collection. If the path is "-", it reads from stdin. Else, it reads from the specified file path.
func (*ToolsLoader) Type ¶ added in v0.0.11
func (t *ToolsLoader) Type() (Type, error)
Type returns the type of tool configuration source.
func (*ToolsLoader) UnmarshalPieceByPiece ¶ added in v0.0.11
func (t *ToolsLoader) UnmarshalPieceByPiece(data []byte) (err error)
UnmarshalPieceByPiece unmarshals the YAML list-item by list-item.
func (*ToolsLoader) UnmarshalWhole ¶ added in v0.0.11
func (t *ToolsLoader) UnmarshalWhole(data []byte) (err error)
UnmarshalWhole unmarshals the entire YAML configuration into the tools collection.