grpc

package
v0.0.0-...-01d4da0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MulanPSL-2.0 Imports: 29 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)

func DialInsecure

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

func NewWrappedStream

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

Types

type ClientOption

type ClientOption func(*clientOptions)

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 WithNodeFilter

func WithNodeFilter(filters ...selector.NodeFilter) ClientOption

WithNodeFilter with select filters

func WithOptions

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

WithOptions with gRPC options.

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) Endpoint

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

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)

func Address

func Address(addr string) ServerOption

func Network

func Network(network string) ServerOption

func Timeout

func Timeout(timeout time.Duration) ServerOption

type Trailer

type Trailer metadata.MD

func (Trailer) Get

func (t Trailer) Get(k string) string

type Transport

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

func (*Transport) Endpoint

func (tr *Transport) Endpoint() string

func (*Transport) Kind

func (tr *Transport) Kind() transport.Kind

func (*Transport) NodeFilters

func (tr *Transport) NodeFilters() []selector.NodeFilter

func (*Transport) Operation

func (tr *Transport) Operation() string

func (*Transport) ReplyHeader

func (tr *Transport) ReplyHeader() transport.Header

func (*Transport) RequestHeader

func (tr *Transport) RequestHeader() transport.Header

Directories

Path Synopsis
resolver

Jump to

Keyboard shortcuts

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