config

package
v0.0.0-...-c3afde3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package config provides connection with environment configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceName                 string `env:"SERVICE_NAME,default=user-server"`
	AppEnv                      string `env:"APP_ENV,default=development"`
	Port                        string `env:"PORT,default=8001"`
	PrometheusPort              string `env:"PROMETHEUS_PORT,default=7001"`
	RelayerSleepTimeMillisecond int    `env:"RELAYER_SLEEP_TIME_MILLISECONDS,default=1000"`
	Postgres                    pgsdk.Config
	Keycloak                    Keycloak
	Tracer                      trace.Config
	Temporal                    Temporal
}

Config holds configuration for the project.

func NewConfig

func NewConfig(env string) (*Config, error)

NewConfig creates an instance of Config. It needs the path of the env file to be used.

type Keycloak

type Keycloak struct {
	Address       string `env:"KEYCLOAK_ADDRESS,default=http://localhost:8080/"`
	Realm         string `env:"KEYCLOAK_REALM,required"`
	AdminUser     string `env:"KEYCLOAK_ADMIN_USER,required"`
	AdminPassword string `env:"KEYCLOAK_ADMIN_PASSWORD,required"`
	Timeout       int    `env:"KEYCLOAK_TIMEOUT_SECONDS,default=5"`
}

Keycloak holds configuration for Keycloak.

type Temporal

type Temporal struct {
	Address string `env:"TEMPORAL_ADDRESS,default=localhost:7233"`
}

Temporal holds configuration for Temporal.

Jump to

Keyboard shortcuts

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