feat: simplify the grpc tls authentication (#1199)

This commit is contained in:
Kevin Wan
2021-11-02 20:42:22 +08:00
committed by GitHub
parent 1ece3a498f
commit 3c894a3fb7
3 changed files with 17 additions and 50 deletions

View File

@@ -38,6 +38,13 @@ func TestWithNonBlock(t *testing.T) {
assert.True(t, options.NonBlock)
}
func TestWithTransportCredentials(t *testing.T) {
var options ClientOptions
opt := WithTransportCredentials(nil)
opt(&options)
assert.Equal(t, 1, len(options.DialOptions))
}
func TestWithUnaryClientInterceptor(t *testing.T) {
var options ClientOptions
opt := WithUnaryClientInterceptor(func(ctx context.Context, method string, req, reply interface{},