config

package
v1.0.0 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 Config

type Config struct {
	Env             EnvType         `yaml:"env" env-required:"true"`
	ApplicationName string          `yaml:"application_name" env-required:"true"`
	Storage         Storage         `yaml:"storage" env-required:"true"`
	GrpcServer      GrpcServer      `yaml:"grpc_server" env-required:"true"`
	Migration       MigrationConfig `yaml:"migrations" env-required:"true"`
	Timeouts        Timeouts        `yaml:"timeouts" env-required:"true"`
	Jwt             Jwt             `yaml:"jwt" env-required:"true"`
	Tracing         Tracing         `yaml:"tracing" env-required:"true"`
	Redis           Redis           `yaml:"redis" 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) GetJwtAccessTokenTTL

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

func (*Config) GetJwtRefreshTokenTTL

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

func (*Config) GetMigrationPostgresConnectionString

func (cfg *Config) GetMigrationPostgresConnectionString() string

func (*Config) GetPostgresConnectionString

func (cfg *Config) GetPostgresConnectionString() string

func (*Config) GetRabbitConnectionString

func (cfg *Config) GetRabbitConnectionString() string

func (*Config) GetRedisEntityTTL

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

type CredentialsCreateQueue

type CredentialsCreateQueue struct {
	Name       string `yaml:"name" env:"RABBIT_CREDENTIALS_CREATE_QUEUE_NAME" env-required:"true"`
	RoutingKey string `yaml:"routing_key" env:"RABBIT_CREDENTIALS_CREATE_QUEUE_ROUTING_KEY" env-required:"true"`
}

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 Jwt

type Jwt struct {
	AccessTokenTTL  string `yaml:"access_token_ttl" env:"JWT_ACCESS_TOKEN_TTL" env-required:"true"`
	RefreshTokenTTL string `yaml:"refresh_token_ttl" env:"JWT_REFRESH_TOKEN_TTL" env-required:"true"`
	Secret          string `yaml:"secret" env:"JWT_SECRET" 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 {
	CredentialsCreate CredentialsCreateQueue `yaml:"credentials_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 Redis

type Redis struct {
	User           string `yaml:"user" env:"REDIS_USER" env-required:"true"`
	Password       string `yaml:"password" env:"REDIS_PASSWORD" env-required:"true"`
	Host           string `yaml:"host" env:"REDIS_HOST" env-required:"true"`
	Port           string `yaml:"port" env:"REDIS_PORT" env-required:"true"`
	DatabaseNumber string `yaml:"database_number" env:"REDIS_DATABASE_NUMBER" env-required:"true"`
	EntityTTL      string `yaml:"entity_ttl" env:"REDIS_ENTITY_TTL" 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"`
	CredentialsTracerName string `yaml:"credentials_tracer_name" env:"CREDENTIALS_TRACER_NAME" env-required:"true"`
	TokenTracerName       string `yaml:"token_tracer_name" env:"TOKEN_TRACER_NAME" env-required:"true"`
}

Jump to

Keyboard shortcuts

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