config

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigString = `
# Valid options and default values
# timeout = "30s"

[aliases] # Section for you URL aliases
# local = http://localhost
`

Variables

View Source
var (
	Editor         string
	DefaultTimeout = time.Second * 30
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Timeout time.Duration
	Verbose bool
	Fail    bool
	Aliases map[string]string
}

func Load

func Load(filepath string) (Config, error)

func New

func New() Config

func ReadTOML

func ReadTOML(data []byte) (Config, error)

ReadTOML loads the Config from a TOML formatted byte slice.

func (Config) String

func (cfg Config) String() string

func (Config) UseFail

func (cfg Config) UseFail(b bool) Config

func (Config) UseVerbose

func (cfg Config) UseVerbose(b bool) Config

func (Config) Write added in v0.13.0

func (cfg Config) Write(w io.Writer) error

Jump to

Keyboard shortcuts

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