config

package
v0.0.0-...-119f62b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigFile = "config.json"

Variables

This section is empty.

Functions

func Init

func Init() error

Init initialize the config package.

Types

type Postgres

type Postgres struct {
	DSN          string
	MaxOpenConns int
	MaxIdleConns int
	TraceOn      bool
	// contains filtered or unexported fields
}

Postgres is the configuration object for Postgres database.

func (*Postgres) Connect

func (m *Postgres) Connect() (db *sql.DB, err error)

Connect connect to the database as go standard database interface.

type RootConfig

type RootConfig struct {
	Server  *ServerConfig
	TerraDB *Postgres
	// contains filtered or unexported fields
}

func GetConfig

func GetConfig() *RootConfig

GetConfig returns the root configuration object.

type ServerConfig

type ServerConfig struct {
	Addr string
}

ServerConfig configs the server.

Jump to

Keyboard shortcuts

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