config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFileNameDefault = "config"
)

Variables

View Source
var AppConfig = AppConfiguration{
	Name:     "pg_featureserv",
	Version:  "0.1",
	EnvDBURL: "DATABASE_URL",
}

Functions

func InitConfig

func InitConfig(configFilename string)

InitConfig initializes the configuration from the config file

Types

type AppConfiguration

type AppConfiguration struct {
	// AppName name of the software
	Name string
	// AppVersion version number of the software
	Version  string
	EnvDBURL string
}

AppConfiguration is the set of global application configuration constants.

type Config

type Config struct {
	Server   Server
	Paging   Paging
	Metadata Metadata
	Database Database
}

Config for system

var Configuration Config

Configuration for system

type Database

type Database struct {
	DbConnection          string
	DbPoolMaxConnLifeTime string
	DbPoolMaxConns        int
}

Database config

type Metadata

type Metadata struct {
	Title       string
	Description string
}

Metadata config

type Paging

type Paging struct {
	LimitDefault int
	LimitMax     int
}

Paging config

type Server

type Server struct {
	HttpHost        string
	HttpPort        int
	UrlBase         string
	CORSOrigins     string
	Debug           bool
	AssetsPath      string
	ReadTimeoutSec  int
	WriteTimeoutSec int
}

Server config

Jump to

Keyboard shortcuts

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