config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath added in v0.1.2

func DefaultPath() (string, error)

DefaultPath returns the default config location for the current OS.

Types

type Config added in v0.1.2

type Config struct {
	Auth struct {
		BearerToken string `toml:"bearer_token"`
	} `toml:"auth"`

	HTTP struct {
		UserAgent string   `toml:"user_agent"`
		Timeout   Duration `toml:"timeout"`
		Retry     int      `toml:"retry"`
	} `toml:"http"`

	Output struct {
		Pretty bool `toml:"pretty"`
	} `toml:"output"`

	Stream struct {
		BackoffMax Duration `toml:"backoff_max"`
	} `toml:"stream"`
}

Config captures user configurable settings for ctw.

func Default added in v0.1.2

func Default() Config

Default returns a config populated with default values.

func Load added in v0.1.2

func Load(path string) (Config, bool, error)

Load reads a config file from the provided path, applying defaults and env refs. The boolean return value indicates whether a file was loaded.

type Duration added in v0.1.2

type Duration time.Duration

Duration wraps time.Duration for TOML decoding (strings like "15s").

func (Duration) Std added in v0.1.2

func (d Duration) Std() time.Duration

func (*Duration) UnmarshalText added in v0.1.2

func (d *Duration) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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