server

package
v0.0.0-...-58ae5d1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package server provides HTTP/2 to HTTP/1.1 gateway server functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcGateway

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

GrpcGateway is responsible to act as HTTP/1.1 server. It composes grpc-gateway runtime.ServeMux.

func NewGrpcGateway

func NewGrpcGateway(port string) *GrpcGateway

NewGrpcGateway creates an instance of GrpcGateway with default production options attached. It enables Prometheus metrics by default.

func (*GrpcGateway) AttachService

func (gg *GrpcGateway) AttachService(fn func(*runtime.ServeMux) error)

AttachService attaches service to gRPC Gateway server. It will be called before serve.

func (*GrpcGateway) EnableHealth

func (gg *GrpcGateway) EnableHealth() error

EnableHealth enables health endpoint. It can be accessed via /health.

func (*GrpcGateway) EnablePrometheus

func (gg *GrpcGateway) EnablePrometheus() error

EnablePrometheus enables prometheus endpoint. It can be accessed via /metrics.

func (*GrpcGateway) GracefulStop

func (gg *GrpcGateway) GracefulStop()

GracefulStop exists just for the sake implementing server interface. It does nothing.

func (*GrpcGateway) Name

func (gg *GrpcGateway) Name() string

Name returns server's name.

func (*GrpcGateway) Port

func (gg *GrpcGateway) Port() string

Port returns server's port.

func (*GrpcGateway) Serve

func (gg *GrpcGateway) Serve() error

Serve runs HTTP/1.1 runtime.ServeMux. It is a blocking method.

Jump to

Keyboard shortcuts

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