config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() (string, error)

Types

type Config

type Config struct {
	BaseURL         string             `json:"base_url,omitempty"`
	TimeoutSeconds  int                `json:"timeout_seconds,omitempty"`
	Output          string             `json:"output,omitempty"`
	Cookie          string             `json:"cookie,omitempty"`
	Headers         map[string]string  `json:"headers,omitempty"`
	CacheTTLSeconds int                `json:"cache_ttl_seconds,omitempty"`
	ActiveContext   string             `json:"active_context,omitempty"`
	Contexts        map[string]Context `json:"contexts,omitempty"`
}

func Load

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

func (*Config) EffectiveContext added in v0.2.0

func (c *Config) EffectiveContext(name string) Context

func (*Config) Save added in v0.2.0

func (c *Config) Save(path string) error

func (*Config) SetContext added in v0.2.0

func (c *Config) SetContext(name string, ctx Context)

type Context added in v0.2.0

type Context struct {
	BaseURL        string            `json:"base_url,omitempty"`
	TimeoutSeconds int               `json:"timeout_seconds,omitempty"`
	Output         string            `json:"output,omitempty"`
	Cookie         string            `json:"cookie,omitempty"`
	Headers        map[string]string `json:"headers,omitempty"`
}

Jump to

Keyboard shortcuts

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