Documentation ¶
Overview ¶
Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type GRPCClientMock
- func (gc *GRPCClientMock) Connect(ctx context.Context, addr string, dopts ...grpc.DialOption) (pool.Conn, error)
- func (gc *GRPCClientMock) ConnectedAddrs() []string
- func (gc *GRPCClientMock) Disconnect(ctx context.Context, addr string) error
- func (gc *GRPCClientMock) IsConnected(ctx context.Context, addr string) bool
- func (gc *GRPCClientMock) OrderedRangeConcurrent(ctx context.Context, order []string, concurrency int, ...) error
- func (gc *GRPCClientMock) SetDisableResolveDNSAddr(addr string, disabled bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCClientMock ¶
type GRPCClientMock struct { grpc.Client OrderedRangeConcurrentFunc func(ctx context.Context, order []string, concurrency int, f func(ctx context.Context, addr string, conn *grpc.ClientConn, copts ...grpc.CallOption) error) error ConnectFunc func(ctx context.Context, addr string, dopts ...grpc.DialOption) (pool.Conn, error) DisconnectFunc func(ctx context.Context, addr string) error IsConnectedFunc func(ctx context.Context, addr string) bool ConnectedAddrsFunc func() []string SetDisableResolveDNSAddrFunc func(addr string, disabled bool) }
GRPCClientMock is the mock for gRPC client.
func (*GRPCClientMock) Connect ¶ added in v1.7.11
func (gc *GRPCClientMock) Connect( ctx context.Context, addr string, dopts ...grpc.DialOption, ) (pool.Conn, error)
Connect calls the ConnectFunc object.
func (*GRPCClientMock) ConnectedAddrs ¶ added in v1.7.11
func (gc *GRPCClientMock) ConnectedAddrs() []string
ConnectedAddrs calls the ConnectedAddrsFunc object.
func (*GRPCClientMock) Disconnect ¶ added in v1.7.11
func (gc *GRPCClientMock) Disconnect(ctx context.Context, addr string) error
Disconnect calls the DisconnectFunc object.
func (*GRPCClientMock) IsConnected ¶ added in v1.7.11
func (gc *GRPCClientMock) IsConnected(ctx context.Context, addr string) bool
IsConnected calls the IsConnectedFunc object.
func (*GRPCClientMock) OrderedRangeConcurrent ¶
func (gc *GRPCClientMock) OrderedRangeConcurrent( ctx context.Context, order []string, concurrency int, f func(ctx context.Context, addr string, conn *grpc.ClientConn, copts ...grpc.CallOption) error, ) error
OrderedRangeConcurrent calls the OrderedRangeConcurrentFunc object.
func (*GRPCClientMock) SetDisableResolveDNSAddr ¶ added in v1.7.14
func (gc *GRPCClientMock) SetDisableResolveDNSAddr(addr string, disabled bool)
SetDisableResolveDNSAddr calls the SetDisableResolveDNSAddr object.