middleware

package
v0.0.0-...-741517b Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNamespace

func GetNamespace(defaultNamespace, fullName string) (string, string)

func GetServiceName

func GetServiceName(urlValue string) string

Types

type AuthInjector

type AuthInjector interface {
	Inject(r *http.Request)
}

AuthInjector is an interface for injecting authentication information into a request which will be proxied or made to a remote/upstream service.

type BaseURLResolver

type BaseURLResolver interface {
	Resolve(r *http.Request) string
	BuildURL(function, namespace, healthPath string, directFunctions bool) string
}

BaseURLResolver URL resolver for upstream requests

type BasicAuthInjector

type BasicAuthInjector struct {
	Credentials *auth.BasicAuthCredentials
}

func (BasicAuthInjector) Inject

func (b BasicAuthInjector) Inject(r *http.Request)

type FunctionAsHostBaseURLResolver

type FunctionAsHostBaseURLResolver struct {
	FunctionSuffix    string
	FunctionNamespace string
}

FunctionAsHostBaseURLResolver resolves URLs using a function from the URL as a host

func (FunctionAsHostBaseURLResolver) BuildURL

func (f FunctionAsHostBaseURLResolver) BuildURL(function, namespace, healthPath string, directFunctions bool) string

func (FunctionAsHostBaseURLResolver) Resolve

Resolve the base URL for a request

type FunctionPrefixTrimmingURLPathTransformer

type FunctionPrefixTrimmingURLPathTransformer struct {
}

FunctionPrefixTrimmingURLPathTransformer removes the "/function/servicename/" prefix from the URL path.

func (FunctionPrefixTrimmingURLPathTransformer) Transform

Transform removes the "/function/servicename/" prefix from the URL path.

type SingleHostBaseURLResolver

type SingleHostBaseURLResolver struct {
	BaseURL string
}

SingleHostBaseURLResolver resolves URLs against a single BaseURL

func (SingleHostBaseURLResolver) BuildURL

func (s SingleHostBaseURLResolver) BuildURL(function, namespace, healthPath string, directFunctions bool) string

func (SingleHostBaseURLResolver) Resolve

Resolve the base URL for a request

type TransparentURLPathTransformer

type TransparentURLPathTransformer struct {
}

TransparentURLPathTransformer passes the requested URL path through untouched.

func (TransparentURLPathTransformer) Transform

Transform returns the URL path unchanged.

type URLPathTransformer

type URLPathTransformer interface {
	Transform(r *http.Request) string
}

URLPathTransformer Transform the incoming URL path for upstream requests

Jump to

Keyboard shortcuts

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