Documentation ¶
Index ¶
Constants ¶
const DirectPAC = "function FindProxyForURL(url, host){ return 'DIRECT'; }"
DirectPAC for simply always returning "DIRECT"
Variables ¶
var DirectProxy = Proxy{}
DirectProxy is used to represent a "DIRECT" value
Functions ¶
This section is empty.
Types ¶
type EngineManager ¶
EngineManager to deal with the starting, stoping, reloading of any runtime
type FirstItemSelector ¶
type FirstItemSelector struct{}
FirstItemSelector simply selects the first item or returns DirectProxy
func (*FirstItemSelector) SelectProxy ¶
func (s *FirstItemSelector) SelectProxy(from Proxies) Proxy
type Loader ¶
Loader to load the pac as a string
func FileLoader ¶
func HTTPLoader ¶
func SmartLoader ¶
SmartLoader attempt to detect if we are using js, a url, or a file path
type OttoEngine ¶
type OttoEngine struct {
// contains filtered or unexported fields
}
OttoEngine struct
func NewOttoEngine ¶
func NewOttoEngine(opts ...OttoEngineOpt) *OttoEngine
NewOttoEngine instance with configuration
func (*OttoEngine) FindProxyForURL ¶
func (o *OttoEngine) FindProxyForURL(in *url.URL) (Proxies, error)
func (*OttoEngine) Reload ¶
func (o *OttoEngine) Reload() error
func (*OttoEngine) Start ¶
func (o *OttoEngine) Start() error
func (*OttoEngine) Stop ¶
func (o *OttoEngine) Stop() error
type OttoEngineOpt ¶
type OttoEngineOpt func(*OttoEngine)
OttoEngineOpt used to configure an OttoEngine via the NewOttoEngine func
func OttoStringLoader ¶
func OttoStringLoader(pac string) OttoEngineOpt
OttoStringLoader implements a string loader
type Proxies ¶
type Proxies []Proxy
Proxies is a slice of Proxy that implements Stringer
func ParseFindProxyString ¶
ParseFindProxyString into a Proxies
type ProxyFinder ¶
ProxyFinder for chosing the proxy for a URL
type ProxySelector ¶
ProxySelector for proxy selection