inject

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inject

type Inject struct {
	PathMap map[string][]InjectContent `cfg:"path_map"`
	// ContentMap is the mime type to inject like "text/html"
	ContentMap map[string][]InjectContent `cfg:"content_map"`
}

func (*Inject) Middleware

func (s *Inject) Middleware() ([]echo.MiddlewareFunc, error)

type InjectContent

type InjectContent struct {

	// Regex is the regex to match the content.
	//  - If regex is not empty, Old will be ignored.
	Regex string `cfg:"regex"`
	// Old is the old content to replace.
	Old string `cfg:"old"`

	New string `cfg:"new"`

	AddPrefix  string `cfg:"add_prefix"`
	AddPostfix string `cfg:"add_postfix"`

	// Value from load name, key value and type is map[string]interface{}
	Value string `cfg:"value"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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