lib

package module
v0.0.0-...-26beee7 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EnvDev  = "dev"
	EnvTest = "test"
	EnvProd = "prod"
)
View Source
const ConfigPath = "./config"

Variables

This section is empty.

Functions

func NewDB

func NewDB(cfg *Config) *sql.DB

func NewLogger

func NewLogger(logDir string) *log.Logger

TODO error, warn, notice

Types

type Config

type Config struct {
	Env    string
	Server serverConfig `toml:"server"`
	DB     dbConfig     `toml:"database"`
}

func NewConfig

func NewConfig(env string) *Config

func (Config) DBConnectionString

func (cfg Config) DBConnectionString() string

func (Config) ServerConnectionString

func (cfg Config) ServerConnectionString() string

type Env

type Env struct {
	Env    string
	DB     *sql.DB
	Logger *log.Logger
}

func NewEnv

func NewEnv() *Env

Jump to

Keyboard shortcuts

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