config

package
v0.0.0-...-a5730d2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMap

type ConfigMap struct {
	DbName               string `validate:"required"` // name of database to connect to
	DbHost               string `validate:"required"` // database server hostname
	DbUser               string `validate:"required"` // database user to connect as
	Password             string `validate:"required"` // password of database user
	SSLMode              string `validate:"required"` // ssl mode to use when connecting to database
	SSLCertFile          string `validate:"required"` // .crt file to use for ssl
	SSLKeyFile           string `validate:"required"` // .key file to use for ssl
	SSLKeyFilePassPhrase string `validate:"required"` // passphrase for .key file
	SSLCAFile            string `validate:"required"` // CA authority to trust
	SSLHostname          string `validate:"required"` // expected hostname on certificate the database server will present
	ServerPort           uint16 `validate:"required"` // port on which to serve the gRPC server on
	DbPort               uint16 `validate:"required"` // port on which to connect to database server on
	MaxConns             uint8  `validate:"required"` // max connections to the database
}

ConfigMap holds configuration data

func FromEnv

func FromEnv() (*ConfigMap, error)

FromEnv fetches configuration data from environment variables

func FromFile

func FromFile(file string) (*ConfigMap, error)

FromFile returns a New ConfigMap with values parsed from file

Jump to

Keyboard shortcuts

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