rewrite

package
Version: v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2014 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "rewrite"

Variables

This section is empty.

Functions

func CliFlags

func CliFlags() []cli.Flag

func FromCli

func FromCli(c *cli.Context) (plugin.Middleware, error)

func FromOther

func FromOther(rw Rewrite) (plugin.Middleware, error)

func GetSpec

func GetSpec() *plugin.MiddlewareSpec

Types

type Rewrite

type Rewrite struct {
	Regexp      string
	Replacement string
	RewriteBody bool
	Redirect    bool
}

func NewRewrite

func NewRewrite(regex, replacement string, rewriteBody, redirect bool) (*Rewrite, error)

func (*Rewrite) NewMiddleware

func (rw *Rewrite) NewMiddleware() (middleware.Middleware, error)

func (*Rewrite) String

func (rw *Rewrite) String() string

type RewriteInstance

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

func NewRewriteInstance

func NewRewriteInstance(spec *Rewrite) (*RewriteInstance, error)

func (*RewriteInstance) ProcessRequest

func (rw *RewriteInstance) ProcessRequest(r request.Request) (*http.Response, error)

func (*RewriteInstance) ProcessResponse

func (rw *RewriteInstance) ProcessResponse(r request.Request, a request.Attempt)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL