Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProxyFactory = map[string]func(ServiceConfig) (Proxy, error){} ListenerFactory = map[string]func(ServiceConfig) (net.Listener, error){} UpstreamDialFactory = map[string]func(ServiceConfig) (DialUpstream, error){} )
Proxy, Listener and Upstream factory
Functions ¶
func ProxyService ¶
func ProxyService(ctx context.Context, c ServiceConfig) error
ProxyService create proxy and forward traffic
Types ¶
type DialUpstream ¶
DialUpstream func to create conn to upstream service
type HTTPConfig ¶
type HTTPConfig struct { Kind string Authn *Parameters Authz *Parameters LogBody bool }
HTTPConfig configuration for HTTP protocol
type ListenerConfig ¶
type ListenerConfig struct { Address string Kind string TLSCert string `json:"tls_cert"` TLSKey string `json:"tls_key"` }
ListenerConfig configuration of inbound channel
type Parameters ¶
Parameters of config
type Proxy ¶
type Proxy interface {
Serve(ctx context.Context, Listener net.Listener, DialUpstream DialUpstream) error
}
Proxy forwards data from listener to upstream connection
type ServiceConfig ¶
type ServiceConfig struct { Name string Listen ListenerConfig Upstream string Grace time.Duration DisableLog bool // RPC properties Timeout time.Duration HTTP HTTPConfig }
ServiceConfig general service configuration
Click to show internal directories.
Click to hide internal directories.