Documentation ¶
Index ¶
- Constants
- func ClientWithProject(register registry.Registry, balancerName string, ...) (grpcProject.ProjectServiceClient, error)
- func ClientWithUser(register registry.Registry, balancerName string, ...) (grpcUser.UserServiceClient, error)
- func NewClient(register registry.Registry, balancerName, serviceName string, ...) (*grpc.ClientConn, error)
- type Options
- type RegisterFunc
- type Resolver
- type ResolverBuilder
- type Server
Constants ¶
View Source
const ( UserServiceName = "project-user" ProjectServiceName = "project-project" )
View Source
const SCHEME = "etcd"
Variables ¶
This section is empty.
Functions ¶
func ClientWithProject ¶
func ClientWithProject(register registry.Registry, balancerName string, interceptor ...grpc.UnaryClientInterceptor) (grpcProject.ProjectServiceClient, error)
func ClientWithUser ¶
func ClientWithUser(register registry.Registry, balancerName string, interceptor ...grpc.UnaryClientInterceptor) (grpcUser.UserServiceClient, error)
func NewClient ¶
func NewClient(register registry.Registry, balancerName, serviceName string, interceptor ...grpc.UnaryClientInterceptor) (*grpc.ClientConn, error)
NewClient 创建一个grpc客户端
Types ¶
type Options ¶
type Options func(s *Server)
func WithUnaryInterceptor ¶
func WithUnaryInterceptor(middleware ...grpc.UnaryServerInterceptor) Options
WithUnaryInterceptor 注入中间件
type RegisterFunc ¶
type RegisterFunc func(s grpc.ServiceRegistrar)
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) ResolveNow ¶
func (r *Resolver) ResolveNow(options resolver.ResolveNowOptions)
type ResolverBuilder ¶
type ResolverBuilder struct {
// contains filtered or unexported fields
}
func NewResolverBuilder ¶
func NewResolverBuilder(r registry.Registry) *ResolverBuilder
func (*ResolverBuilder) Build ¶
func (b *ResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
func (*ResolverBuilder) Scheme ¶
func (b *ResolverBuilder) Scheme() string
type Server ¶
func NewServer ¶
func NewServer(si registry.ServiceInstance, registerService RegisterFunc, opts ...Options) *Server
Click to show internal directories.
Click to hide internal directories.