Back to godoc.org

Package ctxhandler

v0.0.1-lastknown
Latest Go to latest

The latest major version is .

Published: Jan 31, 2020 | License: Apache-2.0 | Module: github.com/caffeinated-expert/aws-k8s-tester

Overview

Package ctxhandler implements context handler.

Index

type ContextAdapter

type ContextAdapter struct {
	Logger  *zap.Logger
	Ctx     context.Context
	Handler ContextHandler
}

ContextAdapter wraps context handler.

func (*ContextAdapter) ServeHTTP

func (ca *ContextAdapter) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ContextHandler

type ContextHandler interface {
	ServeHTTPContext(context.Context, http.ResponseWriter, *http.Request) error
}

ContextHandler handles ServeHTTP with context.

type ContextHandlerFunc

type ContextHandlerFunc func(context.Context, http.ResponseWriter, *http.Request) error

ContextHandlerFunc defines HandlerFunc function signature to wrap context.

func (ContextHandlerFunc) ServeHTTPContext

func (f ContextHandlerFunc) ServeHTTPContext(ctx context.Context, w http.ResponseWriter, req *http.Request) error

ServeHTTPContext serve HTTP requests with context.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier