config

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 4 Imported by: ? 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

Overview

Package config loads holt's connection profiles from ~/.holt/config.yaml: how to reach a hub, including one fronted by an authenticating proxy. A profile carries the admin URL, the tunnel URL to advertise in tokens, and any extra HTTP headers to send; header values expand ${ENV} references so secrets stay out of the file.

It is what the CLI resolves --profile against, and what pkg/expose reads to serve a handler with no configuration in the program. The file is optional: with none, callers fall back to their built-in defaults.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

DefaultPath is ~/.holt/config.yaml.

Types

type Config

type Config struct {
	DefaultProfile string             `yaml:"default_profile"`
	Profiles       map[string]Profile `yaml:"profiles"`
}

Config is the on-disk CLI config: named profiles and which one is used when none is requested.

func Load

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

Load reads the config at path (or DefaultPath when empty). A missing file is not an error: it returns an empty config so the CLI keeps its built-in defaults.

func (*Config) Pick

func (c *Config) Pick(name string) Profile

Pick returns the named profile, or the default profile when name is empty. An unknown or empty selection yields a zero Profile (built-in defaults apply).

type Profile

type Profile struct {
	AdminURL  string            `yaml:"admin_url"`
	Headers   map[string]string `yaml:"headers"`
	TunnelURL string            `yaml:"tunnel_url"`
}

Profile is one hub connection: its admin URL, extra headers, and the tunnel URL enroll advertises in tokens.

func (Profile) ResolvedHeaders

func (p Profile) ResolvedHeaders() map[string]string

ResolvedHeaders returns the profile headers with ${ENV} / $ENV references expanded from the environment, so secrets can live in env rather than in the file.

Jump to

Keyboard shortcuts

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