config

package
v0.0.0-...-9a745d8 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: MIT Imports: 2 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      string              `yaml:"env" toml:"env"`
	Port     int                 `yaml:"port" toml:"port"`
	Logger   Logger              `yaml:"logger" toml:"logger"`
	Database map[string]Database `yaml:"database" toml:"database"`
}

func New

func New(filepath string) (*Config, error)

func (*Config) DefaultDB

func (c *Config) DefaultDB() Database

func (*Config) SelectDB

func (c *Config) SelectDB(name string) Database

type Database

type Database struct {
	Type string `yaml:"type" toml:"type"`
	DSN  string `yaml:"dsn" toml:"dsn"`
}

type Logger

type Logger struct {
	Level string `yaml:"level" toml:"level"`
	Path  string `yaml:"path" toml:"path"`
}

Jump to

Keyboard shortcuts

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