rpcserver

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 20 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 InitBuilder

func InitBuilder()

Types

type ClientOption

type ClientOption func(o *clientOptions)

func WithBalancerName

func WithBalancerName(name string) ClientOption

func WithClientOptions

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

func WithClientStreamInterceptor

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

func WithClientTimeout

func WithClientTimeout(timeout time.Duration) ClientOption

func WithClientUnaryInterceptor

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

func WithDiscovery

func WithDiscovery(d registry.Discovery) ClientOption

func WithEnableTracing

func WithEnableTracing(enable bool) ClientOption

func WithEndpoint

func WithEndpoint(endpoint string) ClientOption

type Server

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

func NewServer

func NewServer(opts ...ServerOption) *Server

func (*Server) Address

func (s *Server) Address() string

func (*Server) Endpoint

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

func (*Server) Start

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

Start 启动grpc的服务

func (*Server) Stop

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

type ServerOption

type ServerOption func(o *Server)

func WithAddress

func WithAddress(address string) ServerOption

func WithLis

func WithLis(lis net.Listener) ServerOption

func WithMetrics

func WithMetrics(metric bool) ServerOption

func WithOptions

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

func WithStreamInterceptor

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

func WithTimeout

func WithTimeout(timeout time.Duration) ServerOption

func WithUnaryInterceptor

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

type Trailer

type Trailer metadata.MD

Trailer is a grpc trailder MD.

func (Trailer) Get

func (t Trailer) Get(k string) string

Get get a grpc trailer value.

Directories

Path Synopsis
resolver
p2c
wrr

Jump to

Keyboard shortcuts

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