config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceName is the name of the service
	ServiceName = "iam-proxy"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host            string
	Port            int
	LogLevel        string
	IAM             IAM
	Environment     Environment
	HTTPTimeout     time.Duration
	ShutdownTimeout time.Duration
	Metric          Metric
	// Internal
	Logger *zap.SugaredLogger `ignored:"true"`
}

Config for iam-proxy service.

func New

func New() (*Config, error)

New populates Config from environment variables and performs initializations in Config struct

func NewDefault

func NewDefault() Config

NewDefault returns a Config with default values only

type Environment

type Environment string

Environment of kubernetes deployment.

const (
	EnvDev   Environment = "development"
	EnvTest  Environment = "test"
	EnvStage Environment = "stage"
	EnvProd  Environment = "production"
)

Valid environments

type IAM

type IAM struct {
	Users  string
	Secret string
}

IAM defines the configuration for the iam auth2 functionalities

type Metric

type Metric struct {
	Enabled        bool
	OtelAgentAddr  string
	OpencensusAddr string
	// OpencensusReconnInterval represents the time interval, in seconds that
	// the OC Agent will attempt to reconnect.
	OpencensusReconnInterval int
	ReportingInterval        time.Duration
}

Metric for OpenCensus trace and metric collection

Jump to

Keyboard shortcuts

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