responsetransformer

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init added in v0.9.0

func Init() error

Init registers the response_transformer middleware.

Types

type AddOptions

type AddOptions struct {
	Headers map[string]string
}

AddOptions defines the headers to be added to the response if they are not already present.

type Options

type Options struct {
	Add    AddOptions
	Set    SetOptions
	Remove RemoveOptions
}

Options defines the total configuration for the response transformer middleware.

type RemoveOptions

type RemoveOptions struct {
	Headers []string
}

RemoveOptions defines the headers to be removed from the response.

type ResponseTransFormaterMiddleware

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

ResponseTransFormaterMiddleware is a middleware that transforms the response by adding, setting, or removing headers.

func NewMiddleware

func NewMiddleware(opts Options) *ResponseTransFormaterMiddleware

NewMiddleware creates a new ResponseTransFormaterMiddleware instance.

func (*ResponseTransFormaterMiddleware) ServeHTTP

type SetOptions added in v0.3.0

type SetOptions struct {
	Headers map[string]string
}

SetOptions defines the headers to be set on the response, overwriting any existing values.

Jump to

Keyboard shortcuts

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