Documentation ¶
Overview ¶
Package redirect implements redirection functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServerFilter ¶
func ServerFilter(ctx context.Context, req interface{}, handle filter.ServerHandleFunc) (interface{}, error)
ServerFilter is the server interceptor.
Types ¶
type Options ¶
type Options struct { // When set to true and the request is HTTP, it will be redirected to HTTPS with the same URI and 301 status code. HTTPToHTTPS bool `yaml:"http_to_https"` // The URI to redirect to. URI string `yaml:"uri"` // Match the URL from the client with regular expressions and redirect. After a successful match, replace the // client's request URI with the redirect URI template. // For example: ["^/iresty/(.)/(.)/(.*)","/$1-$2-$3"] // The first element represents the regular expression to match the URI from the client request, // and the second element represents the URI template to send the redirect to the client after a successful match. RegexURI []string `yaml:"regex_uri"` // HTTP response code. RetCode int `yaml:"ret_code"` // When set to true, append the query string from the original request to the Location Header. // If the uri or regex_uri already contains a query string, the query string from the request will be appended // with an "&". AppendQueryString bool `yaml:"append_query_string"` // contains filtered or unexported fields }
Options is the plugin configuration.
Click to show internal directories.
Click to hide internal directories.