Documentation ¶
Index ¶
- Variables
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(format string, v ...interface{})
- func Info(format string, v ...interface{})
- func NewReverseProxy(cnf *Config) *httputil.ReverseProxy
- func Panic(format string, v ...interface{})
- func Printf(format string, v ...interface{})
- func Start(cnf *Config) error
- func Usage()
- func Warn(format string, v ...interface{})
- func Warning(format string, v ...interface{})
- type BackendStruct
- type Config
- type Option
- func Backend(backend string) Option
- func BackendType(backendType string) Option
- func CertFiles(pemFiles []string) Option
- func CommonName(cn string) Option
- func EnvConfig() Option
- func ListenTo(socket_address string) Option
- func MaxConns(conns int) Option
- func OnlyTCP4() Option
- func OnlyTCP6() Option
- func Organization(org string) Option
- func SelfSign() Option
- func Timeout(timeout time.Duration) Option
- func UsageOnSyntaxError(v bool) Option
- type UTCFormatter
Constants ¶
This section is empty.
Variables ¶
View Source
var EnvconfigPrefix = "DEMARKATE"
envconfig prefix
Functions ¶
func Info ¶ added in v1.2.0
func Info(format string, v ...interface{})
wrapped logging functions for convenience, e.g: demarkate.Info("hello world")
func NewReverseProxy ¶ added in v1.2.0
func NewReverseProxy(cnf *Config) *httputil.ReverseProxy
Types ¶
type BackendStruct ¶ added in v1.2.0
type Config ¶
type Config struct { Protocol string `envconfig:"PROTOCOL"` ListenTo []string `envconfig:"LISTEN_TO"` MaxConns int `envconfig:"MAX_CONNS"` MaxIdleConns int `envconfig:"MAX_IDLE_CONNS"` Timeout time.Duration `envconfig:"TIMEOUT"` ReadHeaderTimeout time.Duration `envconfig:"READHEADERTIMEOUT"` ReadTimeout time.Duration `envconfig:"READTIMEOUT"` WriteTimeout time.Duration `envconfig:"WRITETIMEOUT"` IdleTimeout time.Duration `envconfig:"IDLETIMEOUT"` Backend string `envconfig:"BACKEND"` Backends []string `envconfig:"BACKENDS"` BackendType string `envconfig:"BACKEND_TYPE"` BackendTimeout time.Duration `envconfig:"BACKEND_TIMEOUT"` CertFiles []string `envconfig:"CERT_FILES"` SelfSign bool `envconfig:"SELF_SIGN"` Organization string `envconfig:"SELF_SIGN_ORG"` CommonName string `envconfig:"SELF_SIGN_CN"` EnableMetrics bool `envconfig:"ENABLE_METRICS"` Prometheus string `envconfig:"PROMETHEUS"` MetricsPath string `envconfig:"METRICS_PATH"` UsageOnSyntaxError bool `envconfig:"USAGE"` BackendStructs []BackendStruct `ignored:"true"` URL *url.URL `ignored:"true"` }
New() Config struct, envconfig prefix is DEMARKATE_, e.g DEMARKATE_LISTEN_TO=":1337" DEMARKATE_SELF_SIGN="true"
type Option ¶
type Option func(cnf *Config)
func BackendType ¶
func CommonName ¶
func Organization ¶
func UsageOnSyntaxError ¶
type UTCFormatter ¶
Click to show internal directories.
Click to hide internal directories.