conf

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func DumpConfig

func DumpConfig()

func InitConfig

func InitConfig(configFilename string, isDebug bool)

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
	EnvPrefix string
}

AppConfiguration is the set of global application configuration constants.

type Config

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

Config for system

var Configuration Config

Configuration for system

func (*Config) IsTLSEnabled

func (conf *Config) IsTLSEnabled() bool

IsHTTPSEnabled tests whether HTTPS is enabled

type Database

type Database struct {
	DbConnection          string
	DbPoolMaxConnLifeTime string
	DbPoolMaxConns        int
	TableIncludes         []string
	TableExcludes         []string
	FunctionIncludes      []string
}

Database config

type Metadata

type Metadata struct {
	Title       string //`mapstructure:"METADATA_TITLE"`
	Description string
}

Metadata config

type Paging

type Paging struct {
	LimitDefault int
	LimitMax     int
}

Paging config

type Server

type Server struct {
	HttpHost                 string
	HttpPort                 int
	HttpsPort                int
	TlsServerCertificateFile string
	TlsServerPrivateKeyFile  string
	UrlBase                  string
	BasePath                 string
	CORSOrigins              string
	Debug                    bool
	AssetsPath               string
	ReadTimeoutSec           int
	WriteTimeoutSec          int
	TransformFunctions       []string
}

Server config

type Website

type Website struct {
	BasemapUrl string
}

Jump to

Keyboard shortcuts

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