config

package
v0.0.0-...-591eb45 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package config provides types and methods used for interacting the service configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Version defines the configuration version.
	Version int `toml:"version"`
	// Postgres defines the PostgreSQL database configuration.
	Postgres PostgresConfig `toml:"postgres"`
	// Server defines the HTTP server configuration.
	Server ServerConfig `toml:"server"`
}

Config defines the service configuration.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads configuration from the provided path.

type PostgresConfig

type PostgresConfig struct {
	Host                 string `toml:"host"`
	Port                 int    `toml:"port"`
	MaxOpenedConnections int    `toml:"max_opened_connections"`
	Database             string `toml:"database"`
	Username             string `toml:"username"`
	Password             string `toml:"password"`
	SslMode              string `toml:"ssl_mode"`
}

PostgresConfig defines the services database configuration.

type ServerConfig

type ServerConfig struct {
	Listen                       string   `toml:"listen"`
	ResponseWriteTimeoutDuration duration `toml:"response_write_timeout_duration"`
	RequestReadTimeoutDuration   duration `toml:"request_read_timeout_duration"`
	ShutdownTimeoutDuration      duration `toml:"shutdown_timeout_duration"`
}

ServerConfig defines the HTTP server configuration.

Jump to

Keyboard shortcuts

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