http

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: BSD-3-Clause Imports: 24 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConfigNotFound ...
	ErrConfigNotFound = errors.New("client config is not found")
)
View Source
var (
	// ErrPanic ...
	ErrPanic = errors.New("panic error")
)

Functions

func EndpointPanicMiddleware added in v0.2.9

func EndpointPanicMiddleware() kitendpoint.Middleware

EndpointPanicMiddleware ...

func InitClient

func InitClient(ctx context.Context, peerName string, cfs []config.Client)

InitClient ...

func InitPProf

func InitPProf(ctx context.Context, serviceName string, cfg config.PProf)

InitPProf ...

func ListenAndServe

func ListenAndServe(ctx context.Context, conf config.HTTP, httpHandler http.Handler)

ListenAndServe ...

func NewRouter

func NewRouter() *mux.Router

NewRouter ...

func NewTransport

func NewTransport(cf config.HTTPTransport) *http.Transport

NewTransport ...

func RoundTripperLoggingMiddleware

func RoundTripperLoggingMiddleware(next http.RoundTripper) http.RoundTripper

RoundTripperLoggingMiddleware ...

func RoundTripperMetricsMiddleware added in v0.2.5

func RoundTripperMetricsMiddleware(next http.RoundTripper) http.RoundTripper

RoundTripperTracingMiddleware ...

func RoundTripperTracingMiddleware

func RoundTripperTracingMiddleware(next http.RoundTripper) http.RoundTripper

RoundTripperTracingMiddleware ...

func ServerLoggingMiddleware

func ServerLoggingMiddleware(next http.Handler) http.Handler

ServerLoggingMiddleware ...

func ServerMetricsMiddleware

func ServerMetricsMiddleware(next http.Handler) http.Handler

ServerMetricsMiddleware ...

func ServerTracingMiddleware

func ServerTracingMiddleware(next http.Handler) http.Handler

ServerTracingMiddleware ...

Types

type Client

type Client struct {
	*kithttp.Client
	// contains filtered or unexported fields
}

Client ...

func NewClient

func NewClient(
	ctx context.Context,
	peerName string,
	method string,
	uri string,
	enc kithttp.EncodeRequestFunc,
	dec kithttp.DecodeResponseFunc,
	opt ...kithttp.ClientOption) (*Client, error)

NewClient ...

func (Client) Endpoint

func (c Client) Endpoint() kitendpoint.Endpoint

Endpoint ...

type ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

ResponseWriter ...

func (*ResponseWriter) Write

func (w *ResponseWriter) Write(b []byte) (int, error)

func (*ResponseWriter) WriteHeader

func (w *ResponseWriter) WriteHeader(statusCode int)

WriteHeader ...

type RoundTripper

type RoundTripper struct {
	// contains filtered or unexported fields
}

RoundTripper ...

func NewRoundTripper

func NewRoundTripper(base http.RoundTripper, mwf ...RoundTripperMiddlewareFunc) *RoundTripper

NewRoundTripper ...

func NewRoundTripperFromConfig

func NewRoundTripperFromConfig(cf config.HTTPTransport) *RoundTripper

NewRoundTripperFromConfig ...

func (RoundTripper) RoundTrip

func (r RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip ...

func (*RoundTripper) Use

Use ...

type RoundTripperFunc

type RoundTripperFunc func(*http.Request) (*http.Response, error)

RoundTripperFunc ...

func (RoundTripperFunc) RoundTrip

func (r RoundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip ...

type RoundTripperMiddleware

type RoundTripperMiddleware interface {
	Middleware(http.RoundTripper) http.RoundTripper
}

RoundTripperMiddleware ...

type RoundTripperMiddlewareFunc

type RoundTripperMiddlewareFunc func(http.RoundTripper) http.RoundTripper

RoundTripperMiddlewareFunc ...

func (RoundTripperMiddlewareFunc) Middleware

func (mw RoundTripperMiddlewareFunc) Middleware(roundTripper http.RoundTripper) http.RoundTripper

Middleware allows MiddlewareFunc to implement the middleware interface.

type Server

type Server struct {
	*kithttp.Server
}

Server ...

func NewServer

NewServer ...

Jump to

Keyboard shortcuts

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