config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: GPL-3.0 Imports: 3 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 struct {
	Monitoring MonitoringConfig `group:"Monitoring" namespace:"monitoring" env-namespace:"MONITORING"`
	HTTP       HTTPConfig       `group:"HTTP server" namespace:"http" env-namespace:"HTTP"`
}

func NewConfig

func NewConfig() (Config, error)

type HTTPCORSConfig

type HTTPCORSConfig struct {
	AllowOrigins     []string      `` /* 171-byte string literal not displayed */
	AllowMethods     []string      `` /* 176-byte string literal not displayed */
	AllowHeaders     []string      `long:"allow-header" env:"ALLOW_HEADER" value-name:"HEADER" description:"Headers allowed in CORS requests"`
	AllowCredentials bool          `` /* 155-byte string literal not displayed */
	ExposeHeaders    []string      `` /* 130-byte string literal not displayed */
	MaxAge           time.Duration `` /* 133-byte string literal not displayed */
}

type HTTPConfig

type HTTPConfig struct {
	Port              int            `long:"port" env:"PORT" value-name:"PORT" default:"3001" description:"HTTP port to listen on"`
	CORS              HTTPCORSConfig `group:"CORS support" namespace:"cors" env-namespace:"CORS"`
	BodyLimit         string         `long:"body-limit" env:"BODY_LIMIT" default:"2M" description:"Maximum allowed size for a request body, e.g. 500K, 2M, 1G, etc"`
	GZipLevel         int            `long:"gzip-level" env:"GZIP_LEVEL" default:"-1" description:"HTTP GZip compression level"`
	ReadTimeout       time.Duration  `` /* 138-byte string literal not displayed */
	ReadHeaderTimeout time.Duration  `` /* 133-byte string literal not displayed */
	WriteTimeout      time.Duration  `long:"write-timeout" env:"WRITE_TIMEOUT" default:"30s" description:"Maximum number of seconds to write the response"`
	IdleTimeout       time.Duration  `` /* 130-byte string literal not displayed */
	MaxHeaderBytes    int            `` /* 131-byte string literal not displayed */
	DisableAccessLog  bool           `long:"disable-access-log" env:"DISABLE_ACCESS_LOG" description:"Disable HTTP request access log"`
}

type MonitoringConfig

type MonitoringConfig struct {
	Port              int           `long:"metrics-port" env:"METRICS_PORT" value-name:"PORT" default:"3002" description:"Port to service Prometheus metrics"`
	ReadTimeout       time.Duration `` /* 138-byte string literal not displayed */
	ReadHeaderTimeout time.Duration `` /* 133-byte string literal not displayed */
	WriteTimeout      time.Duration `long:"write-timeout" env:"WRITE_TIMEOUT" default:"5s" description:"Maximum number of seconds to write the response"`
	IdleTimeout       time.Duration `` /* 130-byte string literal not displayed */
	MaxHeaderBytes    int           `` /* 131-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

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