Documentation ¶
Index ¶
- func Context(c *gin.Context) context.Context
- func Dial(ctx context.Context, serviceName string, ch chan []resolver.Address, ...) (*grpc.ClientConn, error)
- func GRPCInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (rsp interface{}, err error)
- type Consul
- type GRPCGraceful
- type Health
- type Resolver
- type ResolverBuilder
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
func Dial(ctx context.Context, serviceName string, ch chan []resolver.Address, opts ...grpc.DialOption) (*grpc.ClientConn, error)
返回客户端对象
func GRPCInterceptor ¶
func GRPCInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (rsp interface{}, err error)
Types ¶
type Consul ¶
type Consul struct {
// contains filtered or unexported fields
}
func (*Consul) ServiceDeregister ¶
func (*Consul) ServiceRegister ¶
type GRPCGraceful ¶
type GRPCGraceful struct {
// contains filtered or unexported fields
}
func NewGRPCGraceful ¶
func NewGRPCGraceful(nett, addr string, s *grpc.Server) *GRPCGraceful
func (*GRPCGraceful) Serve ¶
func (g *GRPCGraceful) Serve() error
type Health ¶
type Health struct{}
func (Health) Check ¶
func (Health) Check(context.Context, *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
func (Health) Watch ¶
func (Health) Watch(*grpc_health_v1.HealthCheckRequest, grpc_health_v1.Health_WatchServer) error
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func (*Resolver) ResolveNow ¶
func (r *Resolver) ResolveNow(o resolver.ResolveNowOptions)
type ResolverBuilder ¶
type ResolverBuilder struct {
// contains filtered or unexported fields
}
func NewResolverBuilder ¶
func NewResolverBuilder(ctx context.Context, ch chan []resolver.Address) *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
Click to show internal directories.
Click to hide internal directories.