config

package
v0.0.0-...-f0c377f Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig

type ApiConfig struct {
	Port           int    `env:"PORT, default=5000"`
	EnvName        string `env:"ENV_NAME, default=development"`
	ApiVersion     string `env:"VERSION, default=v1"`
	LocationRegion string `env:"LOCATION, default=America/Sao_Paulo"`
	Location       *time.Location
}

func (*ApiConfig) IsDevelopment

func (c *ApiConfig) IsDevelopment() bool

type CacheConfig

type CacheConfig struct {
	Host           string `env:"HOST, required"`
	HostSecretName string `env:"HOST_SECRET_NAME, required"`
	Password       string `env:"PASSWORD"`
	DB             int    `env:"DB, default=0"`
}

type CloudConfig

type CloudConfig struct {
	BaseEndpoint         string `env:"BASE_ENDPOINT"`
	AppointmentTopicName string `env:"APPOINTMENT_TOPIC_NAME"`
	FeedbackTopicName    string `env:"FEEDBACK_TOPIC_NAME"`
	BucketName           string `env:"BUCKET_NAME"`
}

func (*CloudConfig) IsBaseEndpointSet

func (c *CloudConfig) IsBaseEndpointSet() bool

type Config

type Config struct {
	ApiConfig   *ApiConfig      `env:",prefix=API_"`
	DbConfig    *DatabaseConfig `env:",prefix=DB_"`
	CloudConfig *CloudConfig    `env:",prefix=AWS_"`
	CacheConfig *CacheConfig    `env:",prefix=CACHE_"`
}

func LoadFromEnv

func LoadFromEnv(ctx context.Context) (*Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Url           string `env:"URL, required"`
	UrlSecretName string `env:"URL_SECRET_NAME, required"`
}

Jump to

Keyboard shortcuts

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