config

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvServiceName is the environment variable name for service name
	EnvServiceName = "SERVICE_NAME"

	// EnvServiceMethod is the environment variable name for service access method
	EnvServiceMethod = "SERVICE_METHOD"

	// EnvWebhookAddress is the environment variable name for webhook address
	EnvWebhookAddress = "WEBHOOK_ADDRESS"

	// EnvServiceAddress is the environment variable name for service address
	EnvServiceAddress = "SERVICE_ADDRESS"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessConfig

type AccessConfig struct {
	ServiceName     string `env:"SERVICE_NAME"`
	SystemNamespace string `env:"SYSTEM_NAMESPACE"`
	WebhookAddress  string `env:"WEBHOOK_ADDRESS"`
}

type Config

type Config struct {
	Trace   TraceConfig
	Log     LogConfig
	Server  ServerConfig
	Service AccessConfig
}

Config global config

func NewConfig

func NewConfig() *Config

type LogConfig

type LogConfig struct {
	Level string `env:"LOG_LEVEL" envDefault:"info"`
	Path  string `env:"LOG_PATH" envDefault:"stderr"`
}

type ServerConfig

type ServerConfig struct {
	Port  int `env:"SERVER_PORT" envDefault:"8080"`
	Debug int `env:"SERVER_DEBUG"`
}

type TraceConfig

type TraceConfig struct {
	Enable          bool    `env:"TRACE_ENABLE"`
	JaegerUrl       string  `env:"TRACE_JAEGER_URL"`
	SampleType      string  `env:"TRACE_SAMPLE_TYPE"`
	SampleParam     float64 `env:"TRACE_SAMPLE_PARAM"`
	SampleServerURL string  `env:"TRACE_SAMPLE_SERVER_URL"`
}

Jump to

Keyboard shortcuts

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