Documentation
¶
Overview ¶
Package config turns a Config file into the Upstream definitions it declares.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse parses Config bytes into the Upstreams to start, in Config order, plus warnings about the Config. lookupEnv resolves ${VAR} references.
Types ¶
type OAuth ¶ added in v0.2.0
type OAuth struct {
// A pre-registered client, in place of Dynamic Client Registration.
ClientID string
ClientSecret string
// The scopes to request, in place of those the Upstream asks for; nil
// when the Config has none.
Scopes []string
}
OAuth is how sprut logs in to an OAuth Upstream, where the Config says.
type Upstream ¶
type Upstream struct {
Name string
Transport Transport
// stdio
Command string
Args []string
Env map[string]string // layered on top of the inherited environment
// HTTP
URL string
Headers map[string]string
OAuth *OAuth // nil when the Config has no "oauth"
// ConfigPath is the absolute path of the Config file, which a command
// run from another shell needs with -c to find it, or "" when it is
// where sprut looks by default. Parse leaves it empty.
ConfigPath string
}
Upstream is one resolved Upstream definition from the Config.
Click to show internal directories.
Click to hide internal directories.