configs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 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 Config

type Config struct {
	Env       string         `env:"ENV" envDefault:"dev"`
	URL       string         `env:"URL" envDefault:"http://localhost"`
	Port      string         `env:"PORT" envDefault:"8080"`
	Postgres  PostgresConfig `envPrefix:"POSTGRES_"`
	JWT       JwtConfig      `envPrefix:"JWT_"`
	Redis     RedisConfig    `envPrefix:"REDIS_"`
	Namespace NamespaceConfig
	SMTP      SMTPConfig     `envPrefix:"SMTP_"`
	Midtrans  MidtransConfig `envPrefix:"MIDTRANS_"`
}

func NewConfig

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

type JwtConfig

type JwtConfig struct {
	SecretKey string `env:"SECRET_KEY"`
}

type MidtransConfig

type MidtransConfig struct {
	ServerKey string `env:"SERVER_KEY" envDefault:""`
	ClientKey string `env:"CLIENT_KEY" envDefault:""`
}

type NamespaceConfig

type NamespaceConfig struct {
	Namespace string `env:"NAMESPACE" envDefault:"application_namespace"`
}

type PostgresConfig

type PostgresConfig struct {
	Host     string `env:"HOST" envDefault:"localhost"`
	Port     string `env:"PORT" envDefault:"5432"`
	User     string `env:"USER" envDefault:"postgres"`
	Password string `env:"PASSWORD" envDefault:"postgres"`
	Database string `env:"DATABASE" envDefault:"postgres"`
}

type RedisConfig

type RedisConfig struct {
	Host     string `env:"HOST_REDIS" envDefault:"localhost"`
	Port     string `env:"PORT_REDIS" envDefault:"6379"`
	Password string `env:"PASSWORD_REDIS" envDefault:""`
}

type SMTPConfig

type SMTPConfig struct {
	Host     string `env:"HOST" envDefault:""`
	Port     int    `env:"PORT" envDefault:""`
	Username string `env:"USERNAME" envDefault:""`
	Password string `env:"PASSWORD" envDefault:""`
	Sender   string `env:"SENDER" envDefault:""`
}

Jump to

Keyboard shortcuts

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