proxy

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddService added in v0.2.0

func AddService(filepath string, service Service) error

AddService adds new service to the filepath

func NewErgoProxy

func NewErgoProxy(config *Config) *httputil.ReverseProxy

NewErgoProxy returns the new reverse proxy.

func ServeProxy added in v0.0.5

func ServeProxy(config *Config) error

ServeProxy listens & serves the HTTP proxy.

Types

type Config

type Config struct {
	Port       string
	Domain     string
	URLPattern string
	Verbose    bool
	Services   []Service
	ConfigFile string
}

Config holds the configuration for the proxy.

func NewConfig added in v0.1.4

func NewConfig() *Config

NewConfig gets the new config.

func (*Config) GetService

func (c *Config) GetService(host string) *Service

GetService gets the service for the given host.

type Service

type Service struct {
	Name string
	URL  string
}

Service holds the details of the service (Name and URL)

func LoadServices added in v0.2.0

func LoadServices(filepath string) ([]Service, error)

LoadServices loads the services from filepath, returns an error if the configuration could not be parsed

func NewService added in v0.2.0

func NewService(name, url string) Service

NewService gets the new service.

Jump to

Keyboard shortcuts

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