Rewrite

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchReplaceType

type MatchReplaceType struct {
	Match    string // regular expression
	And      string // TODO: Requires that a get/post-form variable be set
	AndValue string // TODO: Requires that a get/post-form variable be set to this value.  "" means any value.
	Replace  string // replacement string, with ${1} pattern replacements in it
	Set      string // TODO: Set a new variable in the Params
	SetTo    string // TODO: To a value - will have ${n} values to use in set.
	Template string // TODO: apply templates after replace
}

--------------------------------------------------------------------------------------------------------------------------

type RewriteHandlerType

type RewriteHandlerType struct {
	Next         http.Handler       //
	Paths        []string           //
	MatchReplace []MatchReplaceType // set of match/replaces
	LoopLimit    int                //
	RestartAtTop bool               // If false, then no "loop" to top will occur - just call Next
	LineNo       int                //
	// contains filtered or unexported fields
}

func (*RewriteHandlerType) InitializeWithConfigData

func (hdlr *RewriteHandlerType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, pNo, callNo int) (err error)

func (*RewriteHandlerType) PreValidate

func (hdlr *RewriteHandlerType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, serverName string, pNo, callNo int) (err error)

func (RewriteHandlerType) ServeHTTP

func (hdlr RewriteHandlerType) ServeHTTP(www http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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