config

package
v0.0.0-...-514de64 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	HTTP() *HTTP
	Log() *zap.Logger
}

func New

func New() Config

type HTTP

type HTTP struct {
	Host            string        `env:"CM_HTTP_HOST" envDefault:"localhost"`
	Port            string        `env:"CM_HTTP_PORT" envDefault:"8080"`
	ReqDurThreshold time.Duration `env:"CM_HTTP_REQ_DUR_THRESHOLD" envDefault:"5s"`
}

func (*HTTP) URL

func (h *HTTP) URL() (*url.URL, error)

type Impl

type Impl struct {
	// contains filtered or unexported fields
}

func (*Impl) HTTP

func (c *Impl) HTTP() *HTTP

func (*Impl) Log

func (c *Impl) Log() *zap.Logger

type Log

type Log struct {
	Level      string `env:"CM_LOG_LEVEL" envDefault:"DEBUG"`
	EnableJSON bool   `env:"CM_LOG_ENABLE_JSON" envDefault:"false"`
}

Log core structure responsible for logging in the application

Jump to

Keyboard shortcuts

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