wheat-cache/gateway/proxy/director.go

17 lines
478 B
Go

package proxy
import (
"context"
"gitee.com/timedb/wheatCache/gateway/codec"
"google.golang.org/grpc"
)
func GetDirectorByServiceHash() StreamDirector {
return func(ctx context.Context, fullMethodName string) (context.Context, *grpc.ClientConn, error) {
// TODO hash, mock 直接转发到 storage dev 上
cli, err := grpc.DialContext(ctx, "127.0.0.1:5890", grpc.WithInsecure(), grpc.WithDefaultCallOptions(grpc.ForceCodec(codec.Codec())))
return ctx, cli, err
}
}