gateway

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gateway

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

Gateway provides a RESTful API into MetricStore's gRPC API.

func NewGateway

func NewGateway(metricStoreAddr, gatewayAddr, certPath, keyPath string, opts ...GatewayOption) *Gateway

NewGateway creates a new Gateway. It will listen on the gatewayAddr and submit requests via gRPC to the MetricStore on metricStoreAddr. Start() must be invoked before using the Gateway.

func (*Gateway) Addr

func (g *Gateway) Addr() string

Addr returns the address the gateway is listening on. Start must be called first.

func (*Gateway) Start

func (g *Gateway) Start()

Start starts the gateway to start receiving and forwarding requests. It does not block unless WithGatewayBlock was set.

type GatewayOption

type GatewayOption func(*Gateway)

GatewayOption configures a Gateway.

func WithGatewayBlock

func WithGatewayBlock() GatewayOption

WithGatewayBlock returns a GatewayOption that determines if Start launches a go-routine or not. It defaults to launching a go-routine. If this is set, start will block on serving the HTTP endpoint.

func WithGatewayLogger

func WithGatewayLogger(l *log.Logger) GatewayOption

WithGatewayLogger returns a GatewayOption that configures the logger for the Gateway. It defaults to no logging.

func WithGatewayMetricStoreDialOpts

func WithGatewayMetricStoreDialOpts(opts ...grpc.DialOption) GatewayOption

WithGatewayMetricStoreDialOpts returns a GatewayOption that sets grpc.DialOptions on the metric-store dial

Jump to

Keyboard shortcuts

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