config

package
v0.0.0-...-27571b4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config provides a common infrastructure for reading configuration data stored in local TOML files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(path string, dest interface{}) error

Read takes the TOML configuration file at `path`, parses it into `dest` and then uses github.com/asaskevich/govalidator to validate the struct.

Types

type InvalidConfigError

type InvalidConfigError struct {
	InvalidFields map[string]string
}

InvalidConfigError is the error that is returned when an invalid configuration is encountered by the `Read` func.

func (*InvalidConfigError) Error

func (err *InvalidConfigError) Error() string

type TLS

type TLS struct {
	CertificateFile string `toml:"certificate-file" valid:"required"`
	PrivateKeyFile  string `toml:"private-key-file" valid:"required"`
}

TLS represents a common configuration snippet for configuring TLS in a server process

Jump to

Keyboard shortcuts

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