grpcx

package
v4.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamServerCommonOpts

func StreamServerCommonOpts(ctx context.Context, statsTagsFns ...TagsFunc) []grpc.ServerOption

StreamServerCommonOpts returns commonly options for a stream server.

func UnaryClientCommonOpts

func UnaryClientCommonOpts(ctx context.Context, timeout time.Duration, additional ...grpc.UnaryClientInterceptor) []grpc.DialOption

UnaryClientCommonOpts returns commonly options for an unary client.

func UnaryServerCommonOpts

func UnaryServerCommonOpts(ctx context.Context, statsTagsFns ...TagsFunc) []grpc.ServerOption

UnaryServerCommonOpts returns commonly options for an unary server.

func WithHandlers

func WithHandlers(handlers ...grpcstats.Handler) grpcstats.Handler

WithHandlers returns an aggregated stats handler. All inner handlers are called in order.

func WithRPCStats

func WithRPCStats(stats stats.Stats, tagsFns ...TagsFunc) grpcstats.Handler

WithRPCStats returns a handler that collects and tags RPC stats.

Types

type Server

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

Server represents a GRPC server.

func NewServer

func NewServer(listener net.Listener, srv *grpc.Server) *Server

NewServer creates a new Server instance.

func (*Server) Close

func (s *Server) Close() error

Close closes the listener and frees occupied port.

func (*Server) Serve

func (s *Server) Serve() error

Serve listens for incoming connections and serves RPC responses.

type TagsFunc

type TagsFunc func(ctx context.Context, payload interface{}) stats.Tags

TagsFunc represents a function that returns a set of tags for the stats. The payload is the incoming message object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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