dubbo.apache.org/dubbo-go/v3@v3.1.1/remoting/xds/mocks/client.go (about)

     1  /*
     2   * Licensed to the Apache Software Foundation (ASF) under one or more
     3   * contributor license agreements.  See the NOTICE file distributed with
     4   * this work for additional information regarding copyright ownership.
     5   * The ASF licenses this file to You under the Apache License, Version 2.0
     6   * (the "License"); you may not use this file except in compliance with
     7   * the License.  You may obtain a copy of the License at
     8   *
     9   *     http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   */
    17  
    18  package mocks
    19  
    20  import (
    21  	"github.com/stretchr/testify/mock"
    22  )
    23  
    24  import (
    25  	"dubbo.apache.org/dubbo-go/v3/protocol"
    26  	"dubbo.apache.org/dubbo-go/v3/registry"
    27  	xdsCommon "dubbo.apache.org/dubbo-go/v3/remoting/xds/common"
    28  	"dubbo.apache.org/dubbo-go/v3/xds/client/resource"
    29  )
    30  
    31  // WrappedClientMock is an autogenerated mock type for the WrappedClientMock type
    32  type WrappedClientMock struct {
    33  	mock.Mock
    34  }
    35  
    36  func (m *WrappedClientMock) GetDubboGoMetadata() (map[string]string, error) {
    37  	args := m.Called()
    38  	return args.Get(0).(map[string]string), args.Error(1)
    39  }
    40  
    41  func (m *WrappedClientMock) Subscribe(svcUniqueName, interfaceName, hostAddr string, lst registry.NotifyListener) error {
    42  	args := m.Called(svcUniqueName, interfaceName, hostAddr, lst)
    43  	return args.Error(0)
    44  }
    45  
    46  func (m *WrappedClientMock) UnSubscribe(svcUniqueName string) {
    47  
    48  }
    49  
    50  func (m *WrappedClientMock) GetRouterConfig(hostAddr string) resource.RouteConfigUpdate {
    51  	args := m.Called(hostAddr)
    52  	return args.Get(0).(resource.RouteConfigUpdate)
    53  }
    54  func (m *WrappedClientMock) GetHostAddrByServiceUniqueKey(serviceUniqueKey string) (string, error) {
    55  	args := m.Called(serviceUniqueKey)
    56  	return args.String(0), args.Error(1)
    57  }
    58  func (m *WrappedClientMock) ChangeInterfaceMap(serviceUniqueKey string, add bool) error {
    59  	args := m.Called(serviceUniqueKey, add)
    60  	return args.Error(0)
    61  }
    62  
    63  func (m *WrappedClientMock) GetClusterUpdateIgnoreVersion(hostAddr string) resource.ClusterUpdate {
    64  	args := m.Called(hostAddr)
    65  	return args.Get(0).(resource.ClusterUpdate)
    66  }
    67  
    68  func (m *WrappedClientMock) GetHostAddress() xdsCommon.HostAddr {
    69  	args := m.Called()
    70  	return args.Get(0).(xdsCommon.HostAddr)
    71  }
    72  
    73  func (m *WrappedClientMock) GetIstioPodIP() string {
    74  	args := m.Called()
    75  	return args.String(0)
    76  }
    77  
    78  func (m *WrappedClientMock) MatchRoute(routerConfig resource.RouteConfigUpdate, invocation protocol.Invocation) (*resource.Route, error) {
    79  	args := m.Called(routerConfig, invocation)
    80  	return args.Get(0).(*resource.Route), args.Error(1)
    81  }