config

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONURL added in v0.2.0

type JSONURL struct {
	Str string
	URL url.URL
}

func (*JSONURL) UnmarshalJSON added in v0.2.0

func (j *JSONURL) UnmarshalJSON(b []byte) error

UnmarshalJSON is needed to get a URL from json until golang does it on its own.

type Route

type Route struct {
	// Host or * or empty to match any host (* without a Prefix must be the last rule)
	Host string
	// Prefix or empty for any
	Prefix string
	// Destination url string.
	Destination JSONURL
}

Route configuration. Does Host/Prefix match to destination, see Match* functions. (only host,port,scheme part of Destination URL are used).

func (*Route) MatchHostAndPath added in v1.0.0

func (r *Route) MatchHostAndPath(hostPort, path string) bool

func (*Route) MatchServerReq added in v1.0.0

func (r *Route) MatchServerReq(req *http.Request) bool

Jump to

Keyboard shortcuts

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