ingress

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 3 Imported by: 1

README

go-ingress CI godoc goreportcard license

Go module to create http.Handlers with similar functionality to Kubernetes Ingress objects.

install

go get github.com/frantjc/go-ingress

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ingress added in v0.2.0

type Ingress struct {
	Paths          []Path
	DefaultBackend http.Handler
}

func New

func New(paths ...Path) *Ingress

func (*Ingress) ServeHTTP added in v0.2.0

func (i *Ingress) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Path

type Path interface {
	http.Handler
	// Matches takes a request's path and returns a "weight" representing
	// how strong of a match this path is to the request. <0 is infinity.
	Matches(string) int
}

func ExactPath

func ExactPath(path string, backend http.Handler) Path

func PrefixPath

func PrefixPath(path string, backend http.Handler) Path

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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