grpc

package
v1.0.6-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 4 Imported by: 123

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallOptionFromContext

func CallOptionFromContext(ctx context.Context) []grpc.CallOption

CallOptionFromContext for client

Types

type ClientConnInterface

type ClientConnInterface interface {
	// Invoke performs a unary RPC and returns after the response is received
	// into reply.
	Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error
	// NewStream begins a streaming RPC.
	NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
}

ClientConnInterface defines the functions clients need to perform unary and streaming RPCs. It is implemented by *ClientConn, and is only intended to be referenced by generated code.

Upward compatible for google.golang.org/grpc v1.26.0 and ClientConnInterface define in google.golang.org/grpc v1.28.0+

type HandleOption

type HandleOption func(*HandleOptions)

HandleOption is handle option.

func WithInterceptor

func WithInterceptor(o interceptor.Interceptor) HandleOption

WithInterceptor .

type HandleOptions

type HandleOptions struct {
	Interceptor interceptor.Interceptor
}

HandleOptions is handle options.

func DefaultHandleOptions

func DefaultHandleOptions() *HandleOptions

DefaultHandleOptions .

type ServiceRegistrar

type ServiceRegistrar interface {
	// RegisterService registers a service and its implementation to the
	// concrete type implementing this interface.  It may not be called
	// once the server has started serving.
	// desc describes the service and its methods and handlers. impl is the
	// service implementation which is passed to the method handlers.
	RegisterService(desc *grpc.ServiceDesc, impl interface{})
}

ServiceRegistrar wraps a single method that supports service registration. It enables users to pass concrete types other than grpc.Server to the service registration methods exported by the IDL generated code.

Upward compatible for google.golang.org/grpc v1.28.0 and ServiceRegistrar define in google.golang.org/grpc v1.32.0+

Jump to

Keyboard shortcuts

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