config

package
v0.0.0-...-bfb58f9 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPIReadTimeout  = 5 * time.Second
	DefaultAPIWriteTimeout = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddress   string `split_words:"true" ,default:"0.0.0.0:8081"`
	APIReadTimeout  time.Duration
	APIWriteTimeout time.Duration
	LogFormat       string `default:"json" ,split_words:"true"`
	LogOutput       io.Writer
}

func FromEnv

func FromEnv() (*Config, error)

type Option

type Option func(*Config)

func WithListenAddress

func WithListenAddress(addr string) Option

func WithLogFormat

func WithLogFormat(format string) Option

func WithLogOutput

func WithLogOutput(w io.Writer) Option

Jump to

Keyboard shortcuts

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