github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/service/client/mucp/common_test.go (about) 1 // Copyright 2020 Asim Aslam 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // 15 // Original source: github.com/micro/go-micro/v3/client/mucp/common_test.go 16 17 package mucp 18 19 import ( 20 "github.com/tickoalcantara12/micro/v3/service/registry" 21 ) 22 23 var ( 24 // mock data 25 testData = map[string][]*registry.Service{ 26 "foo": { 27 { 28 Name: "foo", 29 Version: "1.0.0", 30 Nodes: []*registry.Node{ 31 { 32 Id: "foo-1.0.0-123", 33 Address: "localhost:9999", 34 Metadata: map[string]string{ 35 "protocol": "mucp", 36 }, 37 }, 38 { 39 Id: "foo-1.0.0-321", 40 Address: "localhost:9999", 41 Metadata: map[string]string{ 42 "protocol": "mucp", 43 }, 44 }, 45 }, 46 }, 47 { 48 Name: "foo", 49 Version: "1.0.1", 50 Nodes: []*registry.Node{ 51 { 52 Id: "foo-1.0.1-321", 53 Address: "localhost:6666", 54 Metadata: map[string]string{ 55 "protocol": "mucp", 56 }, 57 }, 58 }, 59 }, 60 { 61 Name: "foo", 62 Version: "1.0.3", 63 Nodes: []*registry.Node{ 64 { 65 Id: "foo-1.0.3-345", 66 Address: "localhost:8888", 67 Metadata: map[string]string{ 68 "protocol": "mucp", 69 }, 70 }, 71 }, 72 }, 73 }, 74 } 75 )