location

package
v0.0.0-...-68da624 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2014 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Overview

Interfaces for location - round trip the http request to backends

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstHttpLocation

type ConstHttpLocation struct {
	Url string
}

The simplest HTTP location implementation that adds no additional logic on top of simple http round trip function call

func (*ConstHttpLocation) GetId

func (l *ConstHttpLocation) GetId() string

func (*ConstHttpLocation) RoundTrip

func (l *ConstHttpLocation) RoundTrip(r request.Request) (*http.Response, error)

type Loc

type Loc struct {
	Id   string
	Name string
}

This location is used in tests

func (*Loc) GetId

func (l *Loc) GetId() string

func (*Loc) RoundTrip

func (*Loc) RoundTrip(request.Request) (*http.Response, error)

type Location

type Location interface {
	// Unique identifier of this location
	GetId() string
	// Forward the request to a specific location and return the response
	RoundTrip(request.Request) (*http.Response, error)
}

Location accepts proxy request and round trips it to the backend

Directories

Path Synopsis
HTTP location with load balancing and pluggable middlewares
HTTP location with load balancing and pluggable middlewares

Jump to

Keyboard shortcuts

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