middleware

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

* Copyright 2016 Adobe Systems Incorporated. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License.

* Copyright 2016 Adobe Systems Incorporated. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License.

* Copyright 2016 Adobe Systems Incorporated. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License.

* Copyright 2016 Adobe Systems Incorporated. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License.

* Copyright 2016 Adobe Systems Incorporated. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(route string, inputLog log15.Logger, hdl Handle) httprouter.Handle

func GetParams

func GetParams(ctx context.Context) httprouter.Params

func GetRequestLog

func GetRequestLog(ctx context.Context) log15.Logger

func WithParams

func WithParams(ctx context.Context, value httprouter.Params) context.Context

func WithRequestLog

func WithRequestLog(ctx context.Context, value log15.Logger) context.Context

Types

type CtxResponseWriter

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

CtxResponseWriter is a context-aware http.ResponseWriter. It prevents calls to the real http.ResponseWriter that may already be closed due to a context timeout

func (CtxResponseWriter) Header

func (recv CtxResponseWriter) Header() http.Header

func (CtxResponseWriter) Write

func (recv CtxResponseWriter) Write(bs []byte) (int, error)

func (CtxResponseWriter) WriteHeader

func (recv CtxResponseWriter) WriteHeader(i int)

type Handle

type Handle func(ctx context.Context, w http.ResponseWriter, r *http.Request)

func Profile

func Profile(hdl Handle) Handle

func VersionHeader

func VersionHeader(hdl Handle) Handle

Jump to

Keyboard shortcuts

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