config

package
v0.0.0-...-05212b3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEV  = "development"
	STG  = "staging"
	PROD = "production"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppName string `default:"monorepo" env:"APP_NAME" required:"true" yaml:"app_name"`
	Env     string `default:"development" env:"ENV" yaml:"env"`

	OAuthGithub OAuthGithub `yaml:"oauth_github"`
	Database    Database    `yaml:"database"`
	Server      Server      `yaml:"server"`
}

func LoadConfig

func LoadConfig(filename string) (*Config, error)

type Database

type Database struct {
	Host     string `default:"localhost" env:"DB_HOST" yaml:"host"`
	Port     string `default:"5432" env:"DB_PORT" yaml:"port"`
	User     string `default:"postgres" env:"DB_USER" yaml:"user"`
	Password string `default:"postgres" env:"DB_PASSWORD" yaml:"password"`
	Name     string `default:"monorepo" env:"DB_NAME" yaml:"name"`
}

Database - Database configuration for Postgres

type DoctorConfig

type DoctorConfig struct {
	AppName string `default:"monorepo" env:"APP_NAME" required:"true" yaml:"app_name"`

	Database Database `yaml:"database"`
}

func LoadDoctorConfig

func LoadDoctorConfig(filename string) (*DoctorConfig, error)

type OAuthGithub

type OAuthGithub struct {
	ClientID     string `env:"GITHUB_CLIENT_ID" yaml:"client_id"`
	ClientSecret string `env:"GITHUB_CLIENT_SECRET" yaml:"client_secret"`
	RedirectUri  string `env:"GITHUB_REDIRECT_URI" yaml:"redirect_uri"`
}

OAuthGithub - OAuth configuration for Github

type Server

type Server struct {
	Port            string `default:"8080" env:"PORT" yaml:"port"`
	ShutdownTimeout int    `default:"10" env:"SHUTDOWN_TIMEOUT" yaml:"shutdown_timeout"`
}

Server - Server configuration for HTTP

Jump to

Keyboard shortcuts

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