Documentation
¶
Overview ¶
Package redirects provides functions for parsing and rewriting URLs according to Netlify style _redirects syntax
Index ¶
Constants ¶
View Source
const ( // ConfigFile is the default name of the file containing the redirect rules. // It follows Netlify's syntax but we don't support all of the special options yet // - https://docs.netlify.com/routing/redirects/ // - https://docs.netlify.com/routing/redirects/redirect-options/ ConfigFile = "_redirects" )
Variables ¶
View Source
var ( // ErrNoRedirect is the error thrown when a no redirect rule matches while trying to Rewrite URL. // This means that no redirect applies to the URL and you can fallback to serving actual content instead. ErrNoRedirect = errors.New("no redirect found") )
Functions ¶
Types ¶
type Redirects ¶
type Redirects struct {
// contains filtered or unexported fields
}
func ParseRedirects ¶
ParseRedirects decodes Netlify style redirects from the projects `.../public/_redirects` https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file
Click to show internal directories.
Click to hide internal directories.