Documentation ¶
Index ¶
- Constants
- Variables
- func BindAddress() (bindAddress string)
- func NewNonChunkedRequest(method, url string, r *http.Request) (newRequest *http.Request, err error)
- func NewResolver(servers []string) *net.Resolver
- func RequestBodyTracingEnabled(r *http.Request) bool
- func RequestHeaderTracingEnabled(r *http.Request) bool
- func ResponseBodyTracingEnabled(r *http.Response) bool
- func ResponseHeaderTracingEnabled(r *http.Response) bool
- func SetResolvers(nameservers []string)
- func TraceEventData(r interface{})
- type Config
- type ConfigDNS
- type ConfigErrorCollections
- type ConfigHTTP2
- type ConfigLogging
- type ConfigNetwork
- type ConfigNetworkTimeouts
- type ConfigNewRelic
- type ConfigResponse
- type ConfigResponseEntry
- type ConfigRoute
- type ConfigServer
- type ConfigTLS
- type ConfigTransform
- type ConfigTransformEntry
- type DNSError
- type ProxyTransport
- type Route
- type RouteTree
- type Router
- type Server
Constants ¶
View Source
const ( // DefaultBindingAddress is all addresses DefaultBindingAddress = "0.0.0.0" // DefaultBindingPort is standard unprivileged http DefaultBindingPort = 8080 )
View Source
const TracingEnabled = "enabled"
Variables ¶
View Source
var DefaultResolver *net.Resolver = net.DefaultResolver
View Source
var (
ErrorNotResolvable = errors.New("Unable to resolve ip")
)
View Source
var Settings = &Config{}
Settings contains Viper loaded settings
Functions ¶
func BindAddress ¶
func BindAddress() (bindAddress string)
func NewNonChunkedRequest ¶
func NewResolver ¶
func SetResolvers ¶
func SetResolvers(nameservers []string)
func TraceEventData ¶
func TraceEventData(r interface{})
Types ¶
type Config ¶
type Config struct { ConfigFile string `mapstructure:"config" diff:"config"` DNS ConfigDNS `mapstructure:"dns" diff:"dns"` Logging ConfigLogging `mapstructure:"logging" diff:"logging"` Network ConfigNetwork `mapstructure:"network" diff:"network"` NewRelic ConfigNewRelic `mapstructure:"newrelic" diff:"newrelic"` Response ConfigResponse `mapstructure:"response" diff:"response"` Routes map[string]ConfigRoute `mapstructure:"routes" diff:"routes"` Server ConfigServer `mapstructure:"server" diff:"server"` Transform ConfigTransform `mapstructure:"transform" diff:"transform"` }
func DecodeConfigMap ¶
func (*Config) LoadAndLogDiff ¶
func (*Config) LoadFromMap ¶
type ConfigDNS ¶
type ConfigDNS struct {
Resolvers []string `mapstructure:"resolvers" diff:"resolvers"`
}
type ConfigErrorCollections ¶
type ConfigHTTP2 ¶
type ConfigHTTP2 struct {
Enabled bool `mapstructure:"enabled" diff:"enabled"`
}
type ConfigLogging ¶
type ConfigLogging struct {
Level string `mapstructure:"level" diff:"level"`
}
type ConfigNetwork ¶
type ConfigNetwork struct { MaxIdleConnections int `mapstructure:"max_idle_connections" diff:"max_idle_connections"` MaxIdlePerHost int `mapstructure:"max_idle_per_host" diff:"max_idle_per_host"` Timeouts ConfigNetworkTimeouts `mapstructure:"timeouts" diff:"timeouts"` }
type ConfigNetworkTimeouts ¶
type ConfigNetworkTimeouts struct { Connect time.Duration `mapstructure:"connect" diff:"connect"` Continue time.Duration `mapstructure:"continue" diff:"continue"` IdleConnection time.Duration `mapstructure:"idle_connection" diff:"idle_connection"` Keepalive time.Duration `mapstructure:"keepalive" diff:"keepalive"` TLSHandshake time.Duration `mapstructure:"tls_handshake" diff:"tls_handshake"` Read time.Duration `mapstructure:"read" diff:"read"` Write time.Duration `mapstructure:"write" diff:"write"` }
type ConfigNewRelic ¶
type ConfigNewRelic struct { AppName string `mapstructure:"app_name" diff:"app_name"` Enabled bool `mapstructure:"enabled" diff:"enabled"` ErrorCollector ConfigErrorCollections `mapstructure:"error_collector" diff:"error_collector"` HighSecurity bool `mapstructure:"high_security" diff:"high_security"` HostDisplayName string `mapstructure:"host_display_name" diff:"host_display_name"` Labels map[string]string `mapstructure:"labels" diff:"labels"` LicenseKey string `mapstructure:"license_key" diff:"license_key"` ProxyURL string `mapstructure:"proxy_url" diff:"proxy_url"` }
type ConfigResponse ¶
type ConfigResponse struct { NotFound ConfigResponseEntry `mapstructure:"not_found" diff:"not_found"` ServerError ConfigResponseEntry `mapstructure:"server_error" diff:"server_error"` }
type ConfigResponseEntry ¶
type ConfigRoute ¶
type ConfigServer ¶
type ConfigServer struct { BindAddress string `mapstructure:"bind_address" diff:"bind_address"` Threads int `mapstructure:"threads" diff:"threads"` ShutdownTimeout time.Duration `mapstructure:"shutdown_timeout" diff:"shutdown_timeout" ` HTTP2 ConfigHTTP2 `mapstructure:"http2" diff:"http2"` TLS ConfigTLS `mapstructure:"tls" diff:"tls"` }
type ConfigTransform ¶
type ConfigTransform struct { Request ConfigTransformEntry `mapstructure:"request" diff:"request"` Response ConfigTransformEntry `mapstructure:"response" diff:"response"` }
type ConfigTransformEntry ¶
type ProxyTransport ¶
type ProxyTransport struct {
// contains filtered or unexported fields
}
func NewProxyTransport ¶
func NewProxyTransport(server *Server) *ProxyTransport
type Route ¶
func (*Route) AggregateRequestChunks ¶
type RouteTree ¶
type RouteTree struct {
// contains filtered or unexported fields
}
func NewRouteTree ¶
func NewRouteTree() *RouteTree
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) HandleSignalReload ¶
func (s *Server) HandleSignalReload()
func (*Server) HandleSignalShutdown ¶
func (s *Server) HandleSignalShutdown()
func (*Server) ListenAndServe ¶
func (s *Server) ListenAndServe()
func (*Server) SetupSignalHandlers ¶
Click to show internal directories.
Click to hide internal directories.