config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 6 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 собирает настройки CLI в одну структуру: переменные окружения поверх значений по умолчанию. Флаги команд берут отсюда свои значения по умолчанию, так что порядок — флаг > переменная окружения > значение по умолчанию.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env(name string) string

Env — значение переменной окружения name: пароль из --password-env. Окружение читает только этот пакет.

Types

type Config

type Config struct {
	KeyID     string `koanf:"key_id"`
	KeySecret string `koanf:"key_secret"`
	ProjectID string `koanf:"project_id"`

	ClickHouseURL string `koanf:"clickhouse_url"`
	RedisURL      string `koanf:"redis_url"`
	KafkaURL      string `koanf:"kafka_url"`
	ComputeURL    string `koanf:"compute_url"`
	VPCURL        string `koanf:"vpc_url"`
	IAMURL        string `koanf:"iam_url"`
	IAMAuthURL    string `koanf:"iam_auth_url"`

	// AllowHTTP разрешает http:// не на локальный адрес — стенд без TLS.
	AllowHTTP bool `koanf:"allow_http"`

	// Lang — язык сообщений по LC_ALL, LC_MESSAGES, LANG (первая непустая, как в POSIX).
	Lang string `koanf:"-"`
}

Config — все адреса, ключ и проект в одном месте.

func Load

func Load() (Config, error)

Load читает окружение процесса.

Jump to

Keyboard shortcuts

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