config

package
v0.0.0-...-4131fa7 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: MIT Imports: 10 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 {
	Env Environment `yaml:"-"`

	// TODO: static and storage path are currently the same thing.
	StaticPath      string `yaml:"static_path"`
	DiskStoragePath string `yaml:"disk_storage_path"`

	WebPort int64 `yaml:"web_port"`

	Postgres struct {
		Database string `yaml:"database"`
		Host     string `yaml:"host"`
		Port     string `yaml:"port"`
		User     string `yaml:"user"`
		Password string `yaml:"password"`
	} `yaml:"postgres"`
}

func New

func New(env Environment) (*Config, error)

func (*Config) Fixture

func (cfg *Config) Fixture() (*testfixtures.Loader, error)

func (*Config) MigrationObj

func (cfg *Config) MigrationObj() (*migrate.Migrate, error)

func (*Config) PGSQLConnString

func (cfg *Config) PGSQLConnString() string

func (*Config) SqlxConn

func (cfg *Config) SqlxConn() (*sqlx.DB, error)

func (*Config) Storage

func (cfg *Config) Storage() (storage.Storage, error)

type Environment

type Environment string
const (
	DevEnv  Environment = "development"
	ProdEnv Environment = "production"
)

Jump to

Keyboard shortcuts

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