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 APIConfig

type APIConfig struct {
	AccountServiceGRPCURL string `default:"localhost:4040" envconfig:"ACCOUNT_SERVICE_GRPC_URL"` // domain:port
}

func NewAPIConfig

func NewAPIConfig() (*APIConfig, error)

type AppConfig

type AppConfig struct {
	Env            AppEnv   `default:"local" envconfig:"APP_ENV"`
	Port           int      `default:"5000"`
	GCPProjectID   string   `default:"local" envconfig:"GCP_PROJECT_ID"`
	AllowedOrigins []string `default:"http://local.eitan-flash.com:3000" envconfig:"ALLOWED_ORIGINS"`
	RedisURL       string   `default:"localhost:6379" envconfig:"REDIS_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:"eitandb" 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