plugindemo

package module
v0.0.0-...-0c121ef Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

Request size tracker

A plugin for traefik

Documentation

Overview

Package plugindemo a demo plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error)

New created a new Demo plugin.

Types

type BodyWrapper

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

func NewBodyWrapper

func NewBodyWrapper(body io.ReadCloser) *BodyWrapper

func (*BodyWrapper) Close

func (b *BodyWrapper) Close() error

func (*BodyWrapper) Read

func (b *BodyWrapper) Read(p []byte) (int, error)

type Config

type Config struct {
	WID       string `json:"wid,omitempty"`
	MsgBroker string `json:"broker,omitempty"`
}

Config the plugin configuration.

func CreateConfig

func CreateConfig() *Config

CreateConfig creates the default plugin configuration.

type Demo

type Demo struct {
	WID string
	// contains filtered or unexported fields
}

Demo a Demo plugin.

func (*Demo) ServeHTTP

func (a *Demo) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type ResponseWriterWrapper

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

func NewResponseWritrWrapper

func NewResponseWritrWrapper(rw http.ResponseWriter) *ResponseWriterWrapper

func (*ResponseWriterWrapper) Flush

func (r *ResponseWriterWrapper) Flush()

Flush sends any buffered data to the client.

func (*ResponseWriterWrapper) Header

func (r *ResponseWriterWrapper) Header() http.Header

func (*ResponseWriterWrapper) Hijack

Hijack hijacks the connection.

func (*ResponseWriterWrapper) Write

func (r *ResponseWriterWrapper) Write(d []byte) (int, error)

func (*ResponseWriterWrapper) WriteHeader

func (r *ResponseWriterWrapper) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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