store

package
v0.0.0-...-48dec25 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NumFrom

func NumFrom(s string) uint16

NumFrom string to map a path or proxy name to a port number. The number returned will be in the range min < x < 65536

func PathNameFrom

func PathNameFrom(sep, str string) string

PathNameFrom returns the path name from proxy name str

func ProxyNameFrom

func ProxyNameFrom(sep, str string) string

ProxyNameFrom returns the proxy name normalized from str

Types

type ProxyStore

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

ProxyStore stores our proxies in an efficient fashion for path prefix matching

func New

func New(root url.URL, sep string) *ProxyStore

New returns a store of proxies. Proxies are stored by path even though proxies are named sans forward slashes.

func (*ProxyStore) Add

func (s *ProxyStore) Add(proxy *toxy.Proxy)

Add a proxy

func (*ProxyStore) Delete

func (s *ProxyStore) Delete(proxy *toxy.Proxy)

Delete a proxy

func (*ProxyStore) Get

func (s *ProxyStore) Get(path string) *toxy.Proxy

Get a proxy by path prefix

func (*ProxyStore) Match

func (s *ProxyStore) Match(path string) (url.URL, bool)

Match returns a url.URL and a boolean to indicate whether we matched or are using the default.

func (*ProxyStore) ToMap

func (s *ProxyStore) ToMap() map[string]*toxy.Proxy

ToMap returns the Proxy store entries as a map of proxies

Jump to

Keyboard shortcuts

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