proxy

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

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 17 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,
	slowConsumerTimeout time.Duration,
	m MetricClient,
	disableAccessControl bool,
) *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 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 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 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) *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