grpc

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error)

Dial returns a GRPC connection.

func DialInsecure

func DialInsecure(ctx context.Context, opts ...ClientOption) (*grpc.ClientConn, error)

DialInsecure returns an insecure GRPC connection.

func NewWrappedStream

func NewWrappedStream(ctx context.Context, stream grpc.ServerStream) grpc.ServerStream

Types

type ClientOption

type ClientOption func(o *clientOptions)

ClientOption is gRPC client option.

func WithDiscovery

func WithDiscovery(d registry.Discovery) ClientOption

WithDiscovery with client discovery.

func WithEndpoint

func WithEndpoint(endpoint string) ClientOption

WithEndpoint with client endpoint.

func WithMiddleware

func WithMiddleware(m ...middleware.Middleware) ClientOption

WithMiddleware with client middleware.

func WithOptions

func WithOptions(opts ...grpc.DialOption) ClientOption

WithOptions with gRPC options.

func WithStreamInterceptor

func WithStreamInterceptor(in ...grpc.StreamClientInterceptor) ClientOption

WithStreamInterceptor returns a DialOption that specifies the interceptor for streaming RPCs.

func WithTLSConfig

func WithTLSConfig(c *tls.Config) ClientOption

WithTLSConfig with TLS config.

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOption

WithTimeout with client timeout.

func WithUnaryInterceptor

func WithUnaryInterceptor(in ...grpc.UnaryClientInterceptor) ClientOption

WithUnaryInterceptor returns a DialOption that specifies the interceptor for unary RPCs.

type Server

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

func NewServer

func NewServer(opts ...ServerOption) *Server

func (*Server) Start

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

func (*Server) Stop

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

func (*Server) Use

func (s *Server) Use(selector string, m ...middleware.Middleware)

type ServerOption

type ServerOption func(o *Server)

ServerOption is gRPC server option.

func Address

func Address(addr string) ServerOption

Address with server address.

func CustomHealth

func CustomHealth() ServerOption

func Options

func Options(opts ...grpc.ServerOption) ServerOption

Options with grpc options.

func StreamInterceptor

func StreamInterceptor(in ...grpc.StreamServerInterceptor) ServerOption

StreamInterceptor returns a ServerOption that sets the StreamServerInterceptor for the server.

func TLSConfig

func TLSConfig(t *tls.Config) ServerOption

func Timeout

func Timeout(timeout time.Duration) ServerOption

Timeout with server timeout.

func UnaryInterceptor

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

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

type Trailer

type Trailer metadata.MD

Trailer is a grpc trailer MD.

func (Trailer) Get

func (t Trailer) Get(k string) string

Get get a grpc trailer value.

Directories

Path Synopsis
resolver

Jump to

Keyboard shortcuts

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