config

package
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: GPL-3.0 Imports: 6 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 {
	DB  Database `yaml:"database"`
	JWT Jwt      `yaml:"jwt"`
}

func (*Config) Initialize

func (c *Config) Initialize() *gorm.DB

func (*Config) Read

func (c *Config) Read(f string)

func (*Config) ReadEnv

func (c *Config) ReadEnv()

type Configurer

type Configurer interface {
	Initialize() *gorm.DB
	Read(string)
	ReadEnv()
}

type Database

type Database struct {
	Type     string `yaml:"type" envconfig:"DATABASE_TYPE"`
	Host     string `yaml:"host" envconfig:"DATABASE_HOST"`
	Port     string `yaml:"port" envconfig:"DATABASE_PORT"`
	DBName   string `yaml:"database" envconfig:"DATABASE_DATABASE"`
	Password string `yaml:"password" envconfig:"DATABASE_PASSWORD"`
	User     string `yaml:"user" envconfig:"DATABASE_USER"`
	SslMode  string `yaml:"sslmode" envconfig:"DATABASE_SSLMODE"`
	TimeZone string `yaml:"timezone" envconfig:"DATABASE_TIMEZONE"`
}

type Jwt

type Jwt struct {
	Secret string `yaml:"secret"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL