config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 4 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

Overview

Package config lets every flag be set from the environment, which is how a container is configured.

Index

Constants

View Source
const Prefix = "KOMENT_"

Variables

This section is empty.

Functions

func EnvName

func EnvName(flagName string) string

EnvName is the variable that stands in for a flag: --streamable-http becomes KOMENT_STREAMABLE_HTTP.

func FromEnvironment

func FromEnvironment(flags *flag.FlagSet) error

FromEnvironment fills in any flag the caller did not pass. An explicit flag always wins, so a container's environment sets the default and a person debugging it can still override on the command line.

It runs after Parse because that is the only point at which "was this flag actually given" is knowable.

func Root

func Root() (string, bool)

Root is the repository koment serves. It exists for containers, where the working directory is a mount point rather than somewhere a person cd'd to.

func Usage

func Usage(flags *flag.FlagSet) string

Usage renders the environment variable for each flag, so --help documents both ways of setting it rather than only one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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