Documentation ¶
Index ¶
- func DecodeJSON(req *http.Request, obj interface{}) error
- func NewClient(cfg *ClientConfig) (*http.Client, error)
- func NewTransport(cfg *TransportConfig) (*http.Transport, error)
- func ParseQuery(req *http.Request, obj interface{}) error
- func WriteError(rw http.ResponseWriter, statusCode int, err error)
- func WriteJSON(rw http.ResponseWriter, statusCode int, data interface{}) error
- type ClientConfig
- type ErrorRespMsg
- type Server
- func (s *Server) Done() chan struct{}
- func (s *Server) Error() error
- func (s *Server) Logger() logrus.FieldLogger
- func (s *Server) SetHandler(h http.Handler) *Server
- func (s *Server) SetLogger(logger logrus.FieldLogger)
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) Stop(ctx context.Context) error
- type ServerConfig
- type ServerFlagPrefixer
- type TransportConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSON ¶ added in v0.3.0
func NewClient ¶
func NewClient(cfg *ClientConfig) (*http.Client, error)
New creates a new HTTP client
func NewTransport ¶
func NewTransport(cfg *TransportConfig) (*http.Transport, error)
NewTransport creates a http.Transport
func ParseQuery ¶ added in v0.3.0
func WriteError ¶ added in v0.3.0
func WriteError(rw http.ResponseWriter, statusCode int, err error)
Types ¶
type ClientConfig ¶
type ClientConfig struct { Transport *TransportConfig `json:"transport,omitempty"` Timeout *kilntypes.Duration `json:"timeout,omitempty"` }
Config for creating an HTTP Client
func (*ClientConfig) SetDefault ¶
func (cfg *ClientConfig) SetDefault() *ClientConfig
type ErrorRespMsg ¶ added in v0.3.3
type Server ¶ added in v0.3.0
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶ added in v0.3.0
func NewServer(cfg *ServerConfig) (*Server, error)
func (*Server) Logger ¶ added in v0.3.0
func (s *Server) Logger() logrus.FieldLogger
func (*Server) SetLogger ¶ added in v0.3.0
func (s *Server) SetLogger(logger logrus.FieldLogger)
type ServerConfig ¶ added in v0.3.0
type ServerConfig struct { Entrypoint *kilnnet.EntrypointConfig ReadTimeout *types.Duration ReadHeaderTimeout *types.Duration WriteTimeout *types.Duration IdleTimeout *types.Duration MaxHeaderBytes *int }
func (*ServerConfig) SetDefault ¶ added in v0.3.0
func (cfg *ServerConfig) SetDefault() *ServerConfig
type ServerFlagPrefixer ¶ added in v0.3.1
type ServerFlagPrefixer struct {
// contains filtered or unexported fields
}
func NewServerFlagPrefixer ¶ added in v0.3.1
func NewServerFlagPrefixer(name, defaultAddr string) ServerFlagPrefixer
func (*ServerFlagPrefixer) ConfigFromViper ¶ added in v0.3.1
func (fl *ServerFlagPrefixer) ConfigFromViper(v *viper.Viper) *ServerConfig
type TransportConfig ¶
type TransportConfig struct { Dialer *kilnnet.DialerConfig IdleConnTimeout *kilntypes.Duration ResponseHeaderTimeout *kilntypes.Duration ExpectContinueTimeout *kilntypes.Duration MaxIdleConnsPerHost int MaxConnsPerHost int DisableKeepAlives bool DisableCompression bool EnableHTTP2 bool TLS *kilntls.Config }
TransportConfig options to configure communication between Traefik and the servers
func (*TransportConfig) SetDefault ¶
func (cfg *TransportConfig) SetDefault() *TransportConfig
Click to show internal directories.
Click to hide internal directories.