config

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AutoUpdate     *time.Duration
	CACerts        []*x509.Certificate
	CertData       []byte
	CertPath       string
	Color          core.Color
	ConnectTimeout *time.Duration
	Copy           *bool
	DNSServer      *url.URL
	Format         core.Format
	Headers        []core.KeyVal[string]
	HTTP           core.HTTPVersion
	IgnoreStatus   *bool
	Image          core.ImageSetting
	Insecure       *bool
	KeyData        []byte
	KeyPath        string
	NoEncode       *bool
	NoPager        *bool
	Proxy          *url.URL
	QueryParams    []core.KeyVal[string]
	Redirects      *int
	Retry          *int
	RetryDelay     *time.Duration
	Session        *string
	Silent         *bool
	Timeout        *time.Duration
	Timing         *bool
	TLSMax         *uint16
	TLSMin         *uint16
	Verbosity      *int
	// contains filtered or unexported fields
}

Config represents the configuration options for fetch.

func (*Config) ClientCert added in v0.16.0

func (c *Config) ClientCert() (*tls.Certificate, error)

func (*Config) Merge

func (c *Config) Merge(c2 *Config)

Merge merges the two Configs together, with "c" taking priority.

func (*Config) ParseAutoUpdate added in v0.7.3

func (c *Config) ParseAutoUpdate(value string) error

func (*Config) ParseCACerts added in v0.11.0

func (c *Config) ParseCACerts(value string) error

func (*Config) ParseCert added in v0.16.0

func (c *Config) ParseCert(value string) error

func (*Config) ParseColor

func (c *Config) ParseColor(value string) error

func (*Config) ParseConnectTimeout added in v0.19.0

func (c *Config) ParseConnectTimeout(value string) error

func (*Config) ParseCopy added in v0.17.0

func (c *Config) ParseCopy(value string) error

func (*Config) ParseDNSServer

func (c *Config) ParseDNSServer(value string) error

func (*Config) ParseFormat

func (c *Config) ParseFormat(value string) error

func (*Config) ParseHTTP

func (c *Config) ParseHTTP(value string) error

func (*Config) ParseHeader

func (c *Config) ParseHeader(value string) error

func (*Config) ParseIgnoreStatus

func (c *Config) ParseIgnoreStatus(value string) error

func (*Config) ParseImageSetting added in v0.8.0

func (c *Config) ParseImageSetting(value string) error

func (*Config) ParseInsecure

func (c *Config) ParseInsecure(value string) error

func (*Config) ParseKey added in v0.16.0

func (c *Config) ParseKey(value string) error

func (*Config) ParseMaxTLS added in v0.23.0

func (c *Config) ParseMaxTLS(value string) error

func (*Config) ParseMinTLS added in v0.23.0

func (c *Config) ParseMinTLS(value string) error

func (*Config) ParseNoEncode

func (c *Config) ParseNoEncode(value string) error

func (*Config) ParseNoPager

func (c *Config) ParseNoPager(value string) error

func (*Config) ParseProxy

func (c *Config) ParseProxy(value string) error

func (*Config) ParseQuery

func (c *Config) ParseQuery(value string) error

func (*Config) ParseRedirects

func (c *Config) ParseRedirects(value string) error

func (*Config) ParseRetry added in v0.18.0

func (c *Config) ParseRetry(value string) error

func (*Config) ParseRetryDelay added in v0.18.0

func (c *Config) ParseRetryDelay(value string) error

func (*Config) ParseSession added in v0.17.0

func (c *Config) ParseSession(value string) error

func (*Config) ParseSilent

func (c *Config) ParseSilent(value string) error

func (*Config) ParseTLS

func (c *Config) ParseTLS(value string) error

func (*Config) ParseTimeout

func (c *Config) ParseTimeout(value string) error

func (*Config) ParseTiming added in v0.19.0

func (c *Config) ParseTiming(value string) error

func (*Config) ParseVerbosity

func (c *Config) ParseVerbosity(value string) error

func (*Config) Set

func (c *Config) Set(key, val string) error

Set sets the provided key and value pair, returning any error encountered.

func (*Config) Validate added in v0.23.0

func (c *Config) Validate() error

Validate checks cross-option constraints that can only be evaluated after CLI, global, and host-specific configuration have been merged.

type File

type File struct {
	Global *Config
	Hosts  map[string]*Config
	Path   string
}

File represents a configuration file.

func GetFile

func GetFile(path string) (*File, error)

GetFile returns a config File, or nil if one cannot be found.

func (*File) HostConfig added in v0.17.0

func (f *File) HostConfig(hostname string) *Config

HostConfig returns the Config for the given hostname, using exact match first, then falling back to the most-specific wildcard match.

Jump to

Keyboard shortcuts

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