kongtoml

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 4 Imported by: 3

README

TOML Configuration Loader for Kong

Usage:

kctx := kong.Parse(&cli, kong.Configuration(kongtoml.Loader, ".app.toml", "~/.app.toml"))

Configuration mapping

Mapping is achieved by normalising both flags and configuration entries to hyphen-separated keys.

eg. the flag ftl init go --no-hermit will be mapped to the configuration key init-go-no-hermit = true, with fallback to no-hermit = true.

TOML sections are prefixed to attributes via concatenation with -. eg.

["init go"]
no-hermit = true

Will be mapped to init-go-no-hermit = true

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(r io.Reader) (kong.Resolver, error)

Types

type Resolver

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

func (*Resolver) Resolve

func (r *Resolver) Resolve(kctx *kong.Context, parent *kong.Path, flag *kong.Flag) (interface{}, error)

func (*Resolver) Validate

func (r *Resolver) Validate(app *kong.Application) error

Jump to

Keyboard shortcuts

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