config

package
v0.0.0-...-28654c7 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(c Configurer) error

func ReadConfigProperty

func ReadConfigProperty(c Configurer, queryPath string) (string, error)

Types

type Config

type Config struct {
	Configurer     `json:"-"`
	Env            string `json:"env"`
	LogFile        string `json:"logFile"`
	VerboseLogging bool   `json:"verboseLogging"`
}

func (*Config) Load

func (c *Config) Load() error

func (*Config) LogSummary

func (c *Config) LogSummary()

func (*Config) ReadProperty

func (c *Config) ReadProperty(queryPath string) (string, error)

func (*Config) Validate

func (c *Config) Validate() error

type Configurer

type Configurer interface {
	// Load reads in a configuration as a function of GO_ENV and the validates it. For GO_ENV=development, we'll load
	// the production configuration first and then layer development on top as overrides.
	Load() error

	// LogSummary prints out details about the configuration.
	LogSummary()

	// ReadProperty lets properties be read from the config using a query path
	// (e.g. "objectA.arrayB.0"). If any errors occur, we return an empty string.
	ReadProperty(queryPath string) (string, error)

	// Validates the configuration.
	Validate() error
}

type Http

type Http struct {
	Port int `json:"port"`

	TLSEnable bool   `json:"tlsEnable"`
	TLSCRT    string `json:"tlsCRT"`
	TLSKey    string `json:"tlsKey"`
}

Jump to

Keyboard shortcuts

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