handler

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package handler a plugin to rewrite response body.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

New creates and returns a new rewrite body plugin instance.

Types

type Config

type Config struct {
	LastModified bool                      `json:"lastModified" toml:"lastModified" yaml:"lastModified"`
	Rewrites     []Rewrite                 `json:"rewrites" toml:"rewrites" yaml:"rewrites"`
	LogLevel     int8                      `json:"logLevel" toml:"logLevel" yaml:"logLevel"`
	Monitoring   httputil.MonitoringConfig `json:"monitoring" toml:"monitoring" yaml:"monitoring"`
}

Config holds the plugin configuration.

type Rewrite

type Rewrite struct {
	Regex       string `json:"regex" yaml:"regex" toml:"regex"`
	Replacement string `json:"replacement" yaml:"replacement" toml:"replacement"`
}

Rewrite holds one rewrite body configuration.

Jump to

Keyboard shortcuts

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