github.com/polarismesh/polaris@v1.17.8/apiserver/httpserver/docs/doc.go (about) 1 /** 2 * Tencent is pleased to support the open source community by making Polaris available. 3 * 4 * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 5 * 6 * Licensed under the BSD 3-Clause License (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * https://opensource.org/licenses/BSD-3-Clause 11 * 12 * Unless required by applicable law or agreed to in writing, software distributed 13 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 14 * CONDITIONS OF ANY KIND, either express or implied. See the License for the 15 * specific language governing permissions and limitations under the License. 16 */ 17 18 package docs 19 20 import ( 21 "github.com/polarismesh/specification/source/go/api/v1/traffic_manage" 22 "google.golang.org/protobuf/types/known/wrapperspb" 23 ) 24 25 type BaseResponse struct { 26 Code *wrapperspb.UInt32Value `json:"code"` 27 Info *wrapperspb.StringValue `json:"info"` 28 } 29 30 type BatchQueryResponse struct { 31 Code *wrapperspb.UInt32Value `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` 32 Info *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` 33 Amount *wrapperspb.UInt32Value `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` 34 Size *wrapperspb.UInt32Value `protobuf:"bytes,4,opt,name=size,proto3" json:"size,omitempty"` 35 Total *wrapperspb.UInt32Value `protobuf:"bytes,3,opt,name=total,proto3" json:"total,omitempty"` 36 } 37 38 type BatchWriteResponse struct { 39 Code *wrapperspb.UInt32Value `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` 40 Info *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` 41 } 42 43 // configuration root for route 44 type RouteRule struct { 45 Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` 46 // route rule name 47 Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` 48 // namespace namingspace of routing rules 49 Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` 50 // Enable this router 51 Enable bool `protobuf:"varint,4,opt,name=enable,proto3" json:"enable,omitempty"` 52 // Router type 53 RoutingPolicy traffic_manage.RoutingPolicy `json:"routing_policy,omitempty"` 54 // Routing configuration for router 55 RoutingConfig RuleRoutingConfig `protobuf:"bytes,6,opt,name=routing_config,proto3" json:"routing_config,omitempty"` 56 // revision routing version 57 Revision string `protobuf:"bytes,7,opt,name=revision,proto3" json:"revision,omitempty"` 58 // ctime create time of the rules 59 Ctime string `protobuf:"bytes,8,opt,name=ctime,proto3" json:"ctime,omitempty"` 60 // mtime modify time of the rules 61 Mtime string `protobuf:"bytes,9,opt,name=mtime,proto3" json:"mtime,omitempty"` 62 // etime enable time of the rules 63 Etime string `protobuf:"bytes,10,opt,name=etime,proto3" json:"etime,omitempty"` 64 // priority rules priority 65 Priority uint32 `protobuf:"varint,11,opt,name=priority,proto3" json:"priority,omitempty"` 66 // description simple description rules 67 Description string `protobuf:"bytes,12,opt,name=description,proto3" json:"description,omitempty"` 68 // extendInfo 用于承载一些额外信息 69 // case 1: 升级到 v2 版本时,记录对应到 v1 版本的 id 信息 70 ExtendInfo map[string]string `json:"extendInfo,omitempty"` 71 } 72 73 // RuleRoutingConfig routing configuration 74 type RuleRoutingConfig struct { 75 // rule route chain 76 Rules []traffic_manage.SubRuleRouting `json:"rules,omitempty"` 77 } 78 79 type SimpleService struct { 80 Name *wrapperspb.StringValue `json:"name,omitempty"` 81 Namespace *wrapperspb.StringValue `json:"namespace,omitempty"` 82 } 83 84 // DiscoverRequest 85 // 0: "UNKNOWN", 86 // 1: "INSTANCE", 87 // 2: "CLUSTER", 88 // 3: "ROUTING", 89 // 4: "RATE_LIMIT", 90 // 5: "CIRCUIT_BREAKER", 91 // 6: "SERVICES", 92 // 12: "NAMESPACES", 93 // 13: "FAULT_DETECTOR", 94 type DiscoverRequest struct { 95 Type string `json:"type,omitempty"` 96 Service SimpleService `json:"service,omitempty"` 97 }