grpc

package module
v0.0.0-...-2ab3490 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 21 Imported by: 0

README

grpc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResolverBuilder

func NewResolverBuilder(discovery registry.Discovery) resolver.Builder

Types

type Option

type Option func(o *options)

func Registrar

func Registrar(reg registry.Registrar) Option

func ServerOptions

func ServerOptions(serverOptions ...grpc.ServerOption) Option

func TLS

func TLS(conf *tls.Config) Option

func UnaryInterceptors

func UnaryInterceptors(unaryInterceptors ...grpc.UnaryServerInterceptor) Option

type Resolver

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

func (*Resolver) Close

func (r *Resolver) Close()

func (*Resolver) ResolveNow

func (r *Resolver) ResolveNow(o resolver.ResolveNowOptions)

func (*Resolver) Start

func (r *Resolver) Start() error

type ResolverBuilder

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

func (*ResolverBuilder) Build

Build 创建Resolver并启动服务名解析

func (*ResolverBuilder) Scheme

func (rb *ResolverBuilder) Scheme() string

type Server

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

Server grpc运行实体

func NewServer

func NewServer(port int, services []Service, opts ...Option) (*Server, error)

func (*Server) Host

func (s *Server) Host() string

func (*Server) Port

func (s *Server) Port() int

func (*Server) Services

func (s *Server) Services() []Service

func (*Server) SetServiceInfo

func (s *Server) SetServiceInfo(getter registry.ServiceInfoGetter)

func (*Server) Start

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

func (*Server) Stop

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

func (*Server) String

func (s *Server) String() string

type Service

type Service struct {
	Impl any
	Desc grpc.ServiceDesc
}

Jump to

Keyboard shortcuts

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