proxy

package
v0.0.0-...-3ce1eab Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0, BSD-3-Clause, MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MetricsInterval = 15 * time.Second

Functions

func NewWebsocketHandler

func NewWebsocketHandler(
	m <-chan []byte,
	keepAlive time.Duration,
	egressMetric *metricemitter.Counter,
) *websocketHandler

Types

type AdminAccessMiddleware

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

func (*AdminAccessMiddleware) Wrap

type CORSMiddleware

type CORSMiddleware struct{}

CORSMiddleware provides support for adding CORS headers to OPTIONS requests.

func NewCORSMiddleware

func NewCORSMiddleware() *CORSMiddleware

NewCORSMiddleware is the constructor for CORSMiddleware.

func (CORSMiddleware) Wrap

func (CORSMiddleware) Wrap(h http.Handler, opts ...CORSOption) http.Handler

Wrap appends CORS headers to all responses.

type CORSOption

type CORSOption func(http.ResponseWriter)

CORSOption is the type of all configuration options.

func AllowCredentials

func AllowCredentials() CORSOption

AllowCredentials enables credential sharing.

func AllowHeader

func AllowHeader(header string) CORSOption

AllowHeader configures a single allowed header. For multiple headers, pass in a comma-space deliminated string, e.g., "header-a, header-b".

type DopplerProxy

type DopplerProxy struct {
	*mux.Router
	// contains filtered or unexported fields
}

func NewDopplerProxy

func NewDopplerProxy(
	logAuthorizer auth.LogAccessAuthorizer,
	adminAuthorizer auth.AdminAccessAuthorizer,
	grpcConn GrpcConnector,
	cookieDomain string,
	timeout time.Duration,
	slowConsumerTimeout time.Duration,
	m MetricClient,
	health Health,
	recentLogsHandler http.Handler,
	disableAccessControl bool,
	logCacheClient LogCacheClient,
) *DopplerProxy

type FirehoseHandler

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

func NewFirehoseHandler

func NewFirehoseHandler(grpcConn GrpcConnector, w *WebSocketServer, m MetricClient) *FirehoseHandler

func (*FirehoseHandler) Count

func (h *FirehoseHandler) Count() int64

func (*FirehoseHandler) ServeHTTP

func (h *FirehoseHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GrpcConnector

type GrpcConnector interface {
	Subscribe(ctx context.Context, req *plumbing.SubscriptionRequest) (func() ([]byte, error), error)
}

type Health

type Health interface {
	Set(name string, value float64)
	Inc(name string)
}

type HttpHandler

type HttpHandler struct {
	Messages <-chan []byte
}

func NewHttpHandler

func NewHttpHandler(m <-chan []byte) *HttpHandler

func (*HttpHandler) ServeHTTP

func (h *HttpHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type KeepAlive

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

func NewKeepAlive

func NewKeepAlive(conn *websocket.Conn, keepAliveInterval time.Duration) *KeepAlive

func (*KeepAlive) Run

func (k *KeepAlive) Run()

type LogAccessMiddleware

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

func NewLogAccessMiddleware

func NewLogAccessMiddleware(authorize auth.LogAccessAuthorizer, disableAccessControl bool) *LogAccessMiddleware

func (*LogAccessMiddleware) Wrap

type LogCacheClient

type LogCacheClient interface {
	Read(
		ctx context.Context,
		sourceID string,
		start time.Time,
		opts ...logcache.ReadOption,
	) ([]*loggregator_v2.Envelope, error)
}

type MetricClient

type MetricClient interface {
	NewCounter(name string, opts ...metricemitter.MetricOption) *metricemitter.Counter
	NewGauge(name string, unit string, opts ...metricemitter.MetricOption) *metricemitter.Gauge
	EmitEvent(title string, body string)
}

type RecentLogsHandler

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

func NewRecentLogsHandler

func NewRecentLogsHandler(
	recentLogProvider LogCacheClient,
	t time.Duration,
	m MetricClient,
	logCacheEnabled bool,
) *RecentLogsHandler

func (*RecentLogsHandler) ServeHTTP

func (h *RecentLogsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SetCookieHandler

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

func NewSetCookieHandler

func NewSetCookieHandler(domain string) *SetCookieHandler

func (SetCookieHandler) ServeHTTP

func (h SetCookieHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type StreamHandler

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

func NewStreamHandler

func NewStreamHandler(grpcConn GrpcConnector, w *WebSocketServer, m MetricClient) *StreamHandler

func (*StreamHandler) Count

func (h *StreamHandler) Count() int64

func (*StreamHandler) ServeHTTP

func (h *StreamHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WebSocketServer

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

func NewWebSocketServer

func NewWebSocketServer(slowConsumerTimeout time.Duration, m MetricClient, h Health) *WebSocketServer

func (*WebSocketServer) ServeWS

func (s *WebSocketServer) ServeWS(
	w http.ResponseWriter,
	r *http.Request,
	recv func() ([]byte, error),
	egressMetric *metricemitter.Counter,
)

Jump to

Keyboard shortcuts

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