Skip to content

Commit

Permalink
add Rule field docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Jun 30, 2017
1 parent 16a0635 commit 3ad8e9c
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions redirects.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,28 @@ func (p *Params) Get(key string) interface{} {

// A Rule represents a single redirection or rewrite rule.
type Rule struct {
From string
To string
// From is the path which is matched to perform the rule.
From string

// To is the destination which may be relative, or absolute
// in order to proxy the request to another URL.
To string

// Status is one of the following:
//
// - 3xx a redirect
// - 200 a rewrite
// - defaults to 301 redirect
//
// When proxying this field is ignored.
//
Status int
Force bool

// Force is used to force a rewrite or redirect even
// when a response (or static file) is present.
Force bool

// Params is an optional arbitrary map of key/value pairs.
Params Params
}

Expand Down

0 comments on commit 3ad8e9c

Please sign in to comment.