server

package
v0.0.0-...-87e21a1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Address:              "localhost:8443",
	CertFilename:         "test-certs/server-cert.pem",
	KeyFilename:          "test-certs/server-key.pem",
	ClientCACert:         "test-certs/ca-cert.pem",
	ReflectionAPIEnabled: true,
	TraceEnabled:         false,
}

DefaultConfig default gRPC server options.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address              string
	CertFilename         string
	KeyFilename          string
	ClientCACert         string
	ReflectionAPIEnabled bool
	TraceEnabled         bool
}

Config gRPC server options.

type ShopServer

type ShopServer struct {
	Addr string
	// contains filtered or unexported fields
}

ShopServer is server where gRPC services can be registered in.

func New

func New(opts Config, tls *tls.Config) *ShopServer

New returns initialized grpc server.

func (*ShopServer) GracefulShutdown

func (s *ShopServer) GracefulShutdown()

GracefulShutdown gracefully shutdowns the gRPC server.

func (*ShopServer) ListenAndServe

func (s *ShopServer) ListenAndServe() error

ListenAndServe gRPC server starts listening on given address including the port.

func (*ShopServer) RegisterService

func (s *ShopServer) RegisterService(desc *grpc.ServiceDesc, impl interface{})

RegisterService implements grpc.ServiceRegistrar interface so internals of this type does not need to be exposed.

Jump to

Keyboard shortcuts

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