config

package
v0.0.0-...-a53cbe9 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Port           string `yaml:"client_port" env:"CLIENT_PORT" env-default:"8001"`
	ReactClientURL string `yaml:"react_client_url" env:"REACT_URL" env-default:"http://localhost:3000"`
}

type Config

type Config struct {
	Server Server `yaml:"server"`
	Client Client `yaml:"client_server"`
	OAuth  OAuth  `yaml:"oauth"`
	DB     DB     `yaml:"db"`
}

func GetConfig

func GetConfig() (*Config, error)

type DB

type DB struct {
	URL string `yaml:"url" env:"DATABASE_URL"`
}

type OAuth

type OAuth struct {
	VkClientID         string `yaml:"vk_client_id" env:"VK_CLIENT_ID" env-required:"true"`
	VkClientSecret     string `yaml:"vk_client_secret" env:"VK_CLIENT_SECRET" env-required:"true"`
	VkRedirectURL      string `yaml:"vk_redirect_url" env:"VK_REDIRECT_URL" env-required:"true"`
	GoogleClientID     string `yaml:"google_client_id" env:"GOOGLE_CLIENT_ID" env-required:"true"`
	GoogleClientSecret string `yaml:"google_client_secret" env:"GOOGLE_CLIENT_SECRET" env-required:"true"`
	GoogleRedirectURL  string `yaml:"google_redirect_url" env:"GOOGLE_REDIRECT_URL" env-required:"true"`
}

type Server

type Server struct {
	Port            string        `yaml:"port" env:"PORT" env-default:"8000"`
	ShutdownTimeout time.Duration `yaml:"shutdown_timeout" env:"SHUTDOWN_TIMEOUT" env-default:"5000000000"`
	CORS            []string      `yaml:"cors" env:"CORS" env-separator:"," env-default:"http://127.0.0.1:3000 http://localhost:3000"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳