config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationConfig

type AuthorizationConfig struct {
	Audience                  string `env:"JWT_AUDIENCE, default=app-token-issuer"`
	BuildkiteOrganizationSlug string `env:"JWT_BUILDKITE_ORGANIZATION_SLUG, required"`
	IssuerURL                 string `env:"JWT_ISSUER_URL, default=https://agent.buildkite.com"`
	ConfigurationStatic       string `env:"JWT_JWKS_STATIC"`
}

type BuildkiteConfig

type BuildkiteConfig struct {
	ApiURL string // internal only
	Token  string `env:"BUILDKITE_API_TOKEN, required"`
}

type Config

type Config struct {
	Authorization AuthorizationConfig
	Buildkite     BuildkiteConfig
	Github        GithubConfig
	Observe       ObserveConfig
	Server        ServerConfig
}

func Load

func Load(ctx context.Context) (cfg Config, err error)

type GithubConfig

type GithubConfig struct {
	ApiURL         string // internal only
	PrivateKey     string `env:"GITHUB_APP_PRIVATE_KEY, required"`
	ApplicationID  int64  `env:"GITHUB_APP_ID, required"`
	InstallationID int64  `env:"GITHUB_APP_INSTALLATION_ID, required"`
}

type ObserveConfig

type ObserveConfig struct {
	Enabled                    bool   `env:"OBSERVE_ENABLED, default=false"`
	MetricsEnabled             bool   `env:"OBSERVE_METRICS_ENABLED, default=true"`
	Type                       string `env:"OBSERVE_TYPE, default=grpc"`
	ServiceName                string `env:"OBSERVE_SERVICE_NAME, default=chinmina-bridge"`
	TraceBatchTimeoutSeconds   int    `env:"OBSERVE_TRACE_BATCH_TIMEOUT_SECS, default=20"`
	MetricReadIntervalSeconds  int    `env:"OBSERVE_METRIC_READ_INTERVAL_SECS, default=60"`
	HttpTransportEnabled       bool   `env:"OBSERVE_HTTP_TRANSPORT_ENABLED, default=true"`
	HttpConnectionTraceEnabled bool   `env:"OBSERVE_CONNECTION_TRACE_ENABLED, default=true"`
}

type ServerConfig

type ServerConfig struct {
	Port                   int `env:"SERVER_PORT, default=8080"`
	ShutdownTimeoutSeconds int `env:"SERVER_SHUTDOWN_TIMEOUT_SECS, default=25"`

	OutgoingHttpMaxIdleConns    int `env:"SERVER_OUTGOING_MAX_IDLE_CONNS, default=100"`
	OutgoingHttpMaxConnsPerHost int `env:"SERVER_OUTGOING_MAX_CONNS_PER_HOST, default=20"`
}

Jump to

Keyboard shortcuts

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