config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Env            AppEnv   `default:"local" envconfig:"APP_ENV"`
	RestPort       int      `default:"4000"`
	GRPCPort       int      `default:"4040"`
	AppRootURL     string   `default:"http://account.local.eitan-flash.com:4000" envconfig:"APP_ROOT_URL"`
	GCPProjectID   string   `default:"local" envconfig:"GCP_PROJECT_ID"`
	AllowedOrigins []string `default:"http://local.eitan-flash.com:3000" envconfig:"ALLOWED_ORIGINS"`

	SessionKey          string `default:"sess_key" envconfig:"SESSION_KEY"`
	SessionCookieDomain string `default:"local.eitan-flash.com" envconfig:"SESSION_COOKIE_DOMAIN"`
	GoogleAuthClientKey string `envconfig:"GOOGLE_AUTH_CLIENT_KEY"`
	GoogleAuthSecret    string `envconfig:"GOOGLE_AUTH_SECRET"`

	RedisURL string `default:"localhost:6379" envconfig:"REDIS_URL"`

	WebAppURL string `default:"http://local.eitan-flash.com:3000" envconfig:"WEB_APP_URL"`
}

func NewAppConfig

func NewAppConfig() (*AppConfig, error)

func (AppConfig) IsDeployedEnv

func (a AppConfig) IsDeployedEnv() bool

type AppEnv

type AppEnv string
const (
	Local AppEnv = "local"
	Test  AppEnv = "test"
	Dev   AppEnv = "dev"
	Prod  AppEnv = "prod"
)

type DBConfig

type DBConfig struct {
	Driver   string `default:"mysql"`
	DBName   string `default:"accountdb" envconfig:"DB_NAME"`
	User     string `default:"mysql" envconfig:"DB_USER"`
	Password string `default:"mysql" envconfig:"DB_PASSWORD"`
	URL      string `default:"localhost:13306" envconfig:"DB_URL"`
}

func NewDBConfig

func NewDBConfig() (*DBConfig, error)

func (*DBConfig) Dsn

func (d *DBConfig) Dsn() string

Jump to

Keyboard shortcuts

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