grpc

package
v0.0.0-...-fa62366 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*grpc.Server
	// contains filtered or unexported fields
}

Server is an GRPC server wrapper.

func NewServer

func NewServer(opts ...ServerOption) *Server

NewServer creates an HTTP server by options.

func (*Server) Endpoint

func (s *Server) Endpoint() (*url.URL, error)

Endpoint return a real address to registry endpoint. examples:

grpc://127.0.0.1:9000?isSecure=false

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start start the gRPC server.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop stop the gRPC server.

type ServerOption

type ServerOption func(*Server)

ServerOption is an HTTP server option.

func WithAddress

func WithAddress(addr string) ServerOption

Address with server address.

func WithLogger

func WithLogger(logger zaplog.Logger) ServerOption

WithLogger with server logger.

func WithOptions

func WithOptions(opts ...grpc.ServerOption) ServerOption

WithOptions with grpc options.

func WithUnaryInterceptor

func WithUnaryInterceptor(in ...grpc.UnaryServerInterceptor) ServerOption

WithUnaryInterceptor returns a ServerOption that sets the UnaryServerInterceptor for the server.

Jump to

Keyboard shortcuts

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