delta: github.com/kentaro/delta Index | Files | Directories

package delta

import "github.com/kentaro/delta"

Package delta is an HTTP shadow proxy server that sits between clients and your server(s) to enable "shadow requests".

Index

Package Files

backend.go handler.go response.go server.go

type Backend Uses

type Backend struct {
    IsMaster bool
    Name     string
    Host     string
    Port     int
}

func (*Backend) HostPort Uses

func (backend *Backend) HostPort() string

func (*Backend) URL Uses

func (backend *Backend) URL(pathQuery string) string

type Handler Uses

type Handler struct {
    // contains filtered or unexported fields
}

func NewHandler Uses

func NewHandler(server *Server) *Handler

func (*Handler) ServeHTTP Uses

func (handler *Handler) ServeHTTP(writer http.ResponseWriter, req *http.Request)

type Response Uses

type Response struct {
    Backend      *Backend
    HttpResponse *http.Response
    Data         []byte
    Elapsed      time.Duration
}

func NewResponse Uses

func NewResponse(backend *Backend, httpResponse *http.Response, elapsed time.Duration) (response *Response, err error)

type Server Uses

type Server struct {
    Host     string
    Port     int
    Backends map[string]*Backend
    // contains filtered or unexported fields
}

func NewServer Uses

func NewServer(host string, port int) *Server

func (*Server) AddBackend Uses

func (server *Server) AddBackend(name, host string, port int)

func (*Server) AddMasterBackend Uses

func (server *Server) AddMasterBackend(name, host string, port int)

func (*Server) OnBackendFinished Uses

func (server *Server) OnBackendFinished(handler func(responses map[string]*Response))

func (*Server) OnMungeHeader Uses

func (server *Server) OnMungeHeader(handler func(backend string, header *http.Header))

func (*Server) OnSelectBackend Uses

func (server *Server) OnSelectBackend(handler func(req *http.Request) []string)

func (*Server) Run Uses

func (server *Server) Run()

Directories

PathSynopsis
examples

Package delta imports 8 packages (graph). Updated 2016-07-17. Refresh now. Tools for package owners.