redirect

package
v0.0.0-...-e247606 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redirect

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

Redirect is a helper to perform HTTP redirects.

func New

func New(ctx echo.Context) *Redirect

New initializes a new Redirect

func (*Redirect) Go

func (r *Redirect) Go() error

Go performs the redirect If the request is HTMX boosted, an HTMX redirect will be performed instead of an HTTP redirect

func (*Redirect) Params

func (r *Redirect) Params(params ...any) *Redirect

Params sets the route params

func (*Redirect) Query

func (r *Redirect) Query(query url.Values) *Redirect

Query sets a URL query

func (*Redirect) Route

func (r *Redirect) Route(name string) *Redirect

Route sets the route name to redirect to. Use either this or URL()

func (*Redirect) StatusCode

func (r *Redirect) StatusCode(code int) *Redirect

StatusCode sets the HTTP status code which defaults to http.StatusFound. Does not apply to HTMX redirects.

func (*Redirect) URL

func (r *Redirect) URL(url string) *Redirect

URL sets the URL to redirect to Use either this or Route()

Jump to

Keyboard shortcuts

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