gateway

package
v2.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: Apache-2.0 Imports: 11 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 LogCache's gRPC API.

func NewGateway

func NewGateway(logCacheAddr, gatewayAddr string, opts ...GatewayOption) *Gateway

NewGateway creates a new Gateway. It will listen on the gatewayAddr and submit requests via gRPC to the LogCache on logCacheAddr. 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 WithGatewayLogCacheDialOpts

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

WithGatewayLogCacheDialOpts returns a GatewayOption that sets grpc.DialOptions on the log-cache dial

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 WithGatewayVersion

func WithGatewayVersion(version string) GatewayOption

WithGatewayLogCacheDialOpts returns a GatewayOption that the log-cache version returned by the info endpoint.

Jump to

Keyboard shortcuts

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