Documentation ¶
Index ¶
- Constants
- Variables
- func Call(md grpc_service.Metadata, cb func(*grpc.ClientConn) error) error
- func DialContext(ctx context.Context, opts []grpc.DialOption, scheme string, ...) error
- func DialContextConn(conn *grpc.ClientConn, mds ...grpc_service.Metadata) error
- func DialContextConnection(ctx context.Context, opts []grpc.DialOption, scheme string, ...) (*grpc.ClientConn, error)
- func DialContextEndpoint(ctx context.Context, opts []grpc.DialOption, endpoint string, ...) error
- func DialContextEndpointConnection(ctx context.Context, opts []grpc.DialOption, endpoint string) (*grpc.ClientConn, error)
- type GrpcDialer
Constants ¶
Variables ¶
View Source
var Conn = map[string]*grpc.ClientConn{}
View Source
var DefaultDialOptions = []grpc.DialOption{ grpc.WithKeepaliveParams(keepalive.ClientParameters{ Time: KeepAliveTime, Timeout: KeepAliveTimeout, PermitWithoutStream: true, }), }
Functions ¶
func Call ¶
func Call(md grpc_service.Metadata, cb func(*grpc.ClientConn) error) error
func DialContext ¶
func DialContext(ctx context.Context, opts []grpc.DialOption, scheme string, mds ...grpc_service.Metadata) error
DialContext 根据metadata构建链接池
func DialContextConn ¶ added in v0.2.9
func DialContextConn(conn *grpc.ClientConn, mds ...grpc_service.Metadata) error
func DialContextConnection ¶ added in v0.2.15
func DialContextConnection(ctx context.Context, opts []grpc.DialOption, scheme string, md grpc_service.Metadata) (*grpc.ClientConn, error)
DialContextConnection 根据metadata构建单个链接
func DialContextEndpoint ¶ added in v0.2.5
func DialContextEndpoint(ctx context.Context, opts []grpc.DialOption, endpoint string, mds ...grpc_service.Metadata) error
DialContextEndpoint 使用固定端点构建链接池
func DialContextEndpointConnection ¶ added in v0.2.15
func DialContextEndpointConnection(ctx context.Context, opts []grpc.DialOption, endpoint string) (*grpc.ClientConn, error)
DialContextEndpointConnection 使用固定端点构建链接
Types ¶
type GrpcDialer ¶ added in v0.2.9
type GrpcDialer struct {
// contains filtered or unexported fields
}
func NewGrpcDialer ¶ added in v0.2.9
func NewGrpcDialer( endpoints map[string]string, metadataInfo map[string][]grpc_service.Metadata, opt []grpc.DialOption) *GrpcDialer
Click to show internal directories.
Click to hide internal directories.