listenercmd

package
v0.0.0-...-4f56531 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package listenercmd provides env and flag configuration for go-listener.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddr          string `envconfig:"LISTEN_ADDR"`
	Naggle              bool   `envconfig:"TCP_NAGGLE"`
	FastOpen            bool   `envconfig:"TCP_FAST_OPEN"`
	HTTP2               bool   `envconfig:"HTTP2"`
	TLS                 bool   `envconfig:"TLS"`
	TLSCACertFile       string `envconfig:"TLS_CA_CERT_FILE" default:"cacert.pem"`
	TLSClientAuth       string `envconfig:"TLS_CLIENT_AUTH"`
	TLSCertFile         string `envconfig:"TLS_CERT_FILE" default:"cert.pem"`
	TLSKeyFile          string `envconfig:"TLS_KEY_FILE" default:"key.pem"`
	LetsEncrypt         bool   `envconfig:"LETSENCRYPT"`
	LetsEncryptCacheDir string `envconfig:"LETSENCRYPT_CACHE_DIR" default:"."`
	LetsEncryptEmail    string `envconfig:"LETSENCRYPT_EMAIL"`
	LetsEncryptHosts    string `envconfig:"LETSENCRYPT_HOSTS"`
}

Config is the listener configuration for command line tools.

func NewConfig

func NewConfig(prefixes ...string) *Config

NewConfig creates a Config with values from environment variables.

func (*Config) AddFlags

func (c *Config) AddFlags(fs *flag.FlagSet)

AddFlags adds Config options to the given FlagSet.

func (*Config) Options

func (c *Config) Options() []listener.Option

Options returns listener options from the Config.

Jump to

Keyboard shortcuts

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