home

package
v0.0.0-...-b197db6 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Home

type Home struct {
	component.Base
	// contains filtered or unexported fields
}

func (*Home) HandleRoute

func (home *Home) HandleRoute(ctx context.Context, route string) (http.Handler, error)

func (*Home) Routes

func (home *Home) Routes() component.Routes

type Redirect

type Redirect struct {
	// Target is the target URL to redirect to.
	Target string

	// Fallback is used when target is the empty string.
	Fallback http.Handler

	// Absolute determines if the request path should be appended to the target URL when redirecting.
	// By default this path is always appended, set Absolute to true to prevent this.
	Absolute bool

	// Overrides is a map from paths to URLs that should override the default target.
	Overrides map[string]string

	// Permanent determines if the redirect responses issued should return
	// Permanent Redirect (Status Code 308) or Temporary Redirect (Status Code 307).
	Permanent bool
}

Redirect implements a redirect server that redirects all requests. It implements http.Handler.

func (Redirect) Redirect

func (redirect Redirect) Redirect(r *http.Request) string

Redirect determines the redirect URL for a specific incoming request If it returns the empty string, the fallback is used.

func (Redirect) ServeHTTP

func (redirect Redirect) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface and redirects a single request to redirect.Target.

Jump to

Keyboard shortcuts

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