config

package
v0.0.0-...-d8666a0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvLocal   EnvType = "local"
	EnvDev     EnvType = "dev"
	EnvTesting EnvType = "testing"

	EnvConfigPath string = "APP_CONFIG_PATH"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignmentCreateQueue

type AssignmentCreateQueue struct {
	Name       string `yaml:"name" env:"RABBIT_ASSIGNMENT_CREATE_QUEUE_NAME" env-required:"true"`
	RoutingKey string `yaml:"routing_key" env:"RABBIT_ASSIGNMENT_CREATE_QUEUE_ROUTING_KEY" env-required:"true"`
}

type AuthenticationService

type AuthenticationService struct {
	Host string `yaml:"host" env:"AUTHENTICATION_SERVICE_HOST" env-required:"true"`
	Port string `yaml:"port" env:"AUTHENTICATION_SERVICE_PORT" env-required:"true"`
}

type Config

type Config struct {
	Env             EnvType         `yaml:"env" env-required:"true"`
	ApplicationName string          `yaml:"application_name" env-required:"true"`
	GrpcServer      GrpcServer      `yaml:"grpc_server" env-required:"true"`
	Storage         Storage         `yaml:"storage" env-required:"true"`
	Migration       MigrationConfig `yaml:"migrations" env-required:"true"`
	Services        Services        `yaml:"services" env-required:"true"`
	Timeouts        Timeouts        `yaml:"timeouts" env-required:"true"`
	Tracing         Tracing         `yaml:"tracing" env-required:"true"`
	Rabbit          Rabbit          `yaml:"rabbit" env-required:"true"`
}

func Load

func Load() (*Config, error)

func (*Config) GetEndpointExecutionTimeout

func (cfg *Config) GetEndpointExecutionTimeout() time.Duration

func (*Config) GetPostgresConnectionString

func (cfg *Config) GetPostgresConnectionString() string

func (*Config) GetPostgresMigrationConnectionString

func (cfg *Config) GetPostgresMigrationConnectionString() string

func (*Config) GetRabbitConnectionString

func (cfg *Config) GetRabbitConnectionString() string

type EnvType

type EnvType string

type GrpcServer

type GrpcServer struct {
	Port    string `yaml:"port" env:"GRPC_SERVER_PORT" env-required:"true"`
	Timeout string `yaml:"timeout" env:"GRPC_SERVER_TIMEOUT" env-required:"true"`
}

type MigrationConfig

type MigrationConfig struct {
	MigrationsPath      string `yaml:"migrations_path" env:"MIGRATIONS_PATH" env-required:"true"`
	MigrationsTableName string `yaml:"migrations_table_name" env:"MIGRATIONS_TABLE_NAME" env-default:"migrations"`
}

type Queues

type Queues struct {
	AssignmentCreate AssignmentCreateQueue `yaml:"assignment_create" env-required:"true"`
}

type Rabbit

type Rabbit struct {
	User     string         `yaml:"user" env:"RABBIT_USER" env-required:"true"`
	Password string         `yaml:"password" env:"RABBIT_PASSWORD" env-required:"true"`
	Host     string         `yaml:"host" env:"RABBIT_HOST" env-required:"true"`
	Port     string         `yaml:"port" env:"RABBIT_PORT" env-required:"true"`
	Exchange RabbitExchange `yaml:"exchange" env-required:"true"`
	Queues   Queues         `yaml:"queues" env-required:"true"`
}

type RabbitExchange

type RabbitExchange struct {
	Name string `yaml:"name" env:"RABBIT_EXCHANGE_NAME" env-required:"true"`
	Type string `yaml:"type" env:"RABBIT_EXCHANGE_TYPE" env-required:"true"`
}

type Services

type Services struct {
	Authentication AuthenticationService `yaml:"authentication_service" env-required:"true"`
}

type Storage

type Storage struct {
	Host         string `yaml:"host" env:"POSTGRES_HOST" env-required:"true"`
	Port         string `yaml:"port" env:"POSTGRES_PORT" env-required:"true"`
	DatabaseName string `yaml:"database_name" env:"POSTGRES_DATABASE_NAME" env-required:"true"`
	User         string `yaml:"user" env:"POSTGRES_USER" env-required:"true"`
	Password     string `yaml:"password" env:"POSTGRES_PASSWORD" env-required:"true"`
}

type Timeouts

type Timeouts struct {
	EndpointExecutionTimeoutMS string `yaml:"endpoint_execution_timeout_ms" env:"ENDPOINT_EXECUTION_TIMEOUT_MS" env-required:"true"`
}

type Tracing

type Tracing struct {
	Host                 string `yaml:"host" env:"JAEGER_HOST" env-required:"true"`
	Port                 string `yaml:"port" env:"JAEGER_PORT" env-required:"true"`
	AssignmentTracerName string `yaml:"assignment_tracer_name" env:"ASSIGNMENT_TRACER_NAME" env-required:"true"`
}

Jump to

Keyboard shortcuts

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