proxy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package proxy provides a WebDriver protocol that forwards requests to a WebDriver server provided by an environment.Env.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHTTPHandlerProvider

func AddHTTPHandlerProvider(route string, provider HTTPHandlerProvider)

AddHTTPHandlerProvider adds a HTTPHandlerProvider used to create handlers for specified routes in any Proxy structs creates by New.

Types

type HTTPHandler

type HTTPHandler interface {
	http.Handler
	healthreporter.HealthReporter

	// Shutdown is called when the proxy is in the process of shutting down.
	Shutdown(context.Context) error
}

A HTTPHandler implements http.Handler plus a Shutdown method.

type HTTPHandlerProvider

type HTTPHandlerProvider func(*Proxy) (HTTPHandler, error)

A HTTPHandlerProvider is a function that provides a HTTPHandler.

type Proxy

type Proxy struct {
	Diagnostics  diagnostics.Diagnostics
	Env          environment.Env
	Metadata     *metadata.Metadata
	HTTPAddress  string
	HTTPSAddress string
	// contains filtered or unexported fields
}

Proxy starts a WebDriver protocol proxy.

func New

New creates a new Proxy object.

func (*Proxy) Healthy

func (p *Proxy) Healthy(ctx context.Context) error

Healthy returns nil if the proxy is able to receive requests.

func (*Proxy) Name

func (*Proxy) Name() string

Name returns the name used in error messages.

func (*Proxy) Shutdown

func (p *Proxy) Shutdown(ctx context.Context) error

Shutdown calls Shutdown on all handlers, then shuts the HTTP server down.

func (*Proxy) Start

func (p *Proxy) Start(ctx context.Context) error

Start configures the proxy with handlers, starts its listen loop, and waits for it to respond to a health check.

Directories

Path Synopsis
Package driverhub provides a handler for proxying connections to a Selenium server.
Package driverhub provides a handler for proxying connections to a Selenium server.
debugger
Package debugger enables WTL Debugger.
Package debugger enables WTL Debugger.
drivermu
Package drivermu implements a handler that temporally serializes all commands to a session.
Package drivermu implements a handler that temporally serializes all commands to a session.
googlescreenshot
Package googlescreenshot includes a handler for an advanced screenshot endpoint at POST google/screenshot.
Package googlescreenshot includes a handler for an advanced screenshot endpoint at POST google/screenshot.
quithandler
Package quithandler checks if a window close command is closing the last window and treats it as a quit if it is.
Package quithandler checks if a window close command is closing the last window and treats it as a quit if it is.
scripttimeout
Package scripttimeout translates calls to set script timeout into calls on the WebDriver object so it can record the last set script timeout.
Package scripttimeout translates calls to set script timeout into calls on the WebDriver object so it can record the last set script timeout.
Package healthz provides an HTTPHandler that always returns the string "ok".
Package healthz provides an HTTPHandler that always returns the string "ok".

Jump to

Keyboard shortcuts

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