Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotKedgeDestination = errors.New("not a kedge destination")
)
Functions ¶
func RouteMapper ¶
func RouteMapper(r []RouteGetter) *routeMapper
RouteMapper is a mapper that resolves Route based on given DNS.
Types ¶
type Mapper ¶
type Mapper interface { // Map maps a target's DNS name (e.g. myservice.prod.ext.europe-cluster.local) to a Route. // If the targets shouldn't be proxied, ErrNotKedgeDestination should be returned. Map(targetAuthorityDnsName string) (*Route, error) }
Mapper is an interface that allows you to direct traffic to different kedges including various auth. These are used by client libraries.
func Single ¶
Single is a simplistic kedge mapper that forwards all traffic through the same kedge. No auth is involved.
func Suffix ¶
Suffix is a `kedge.Mapper` that copies over wildcarded parts of a URL.
For example: given a matchPattern of *.*.clusters.local, and a URL of `myservice.mynamespace.svc.us1.prod.clusters.local` and a suffixMapper of `.clusters.example.com`, it will return a kedge url of `us1.prod.clusters.example.com`.
Scheme needs to be `http` or `https`
type Route ¶
type Route struct { // URL specifies public URL to the Kedge fronting route destination. // The returned Scheme is deciding whether the Kedge connection is secure. URL *url.URL // BackendAuth represents optional auth for end application. Sometimes it is required to be injected here, because of common // restriction blocking auth headers in plain HTTP requests (even when communication locally with local forward proxy). BackendAuth auth.Source // ProxyAuth represents optional auth for kedge. ProxyAuth auth.Source }
Click to show internal directories.
Click to hide internal directories.