package pb import ( "fmt" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/proto" ) // CountAllUpgradeHTTPDNSNodesWithClusterIdRequest 计算需要升级的HTTPDNS节点数量 type CountAllUpgradeHTTPDNSNodesWithClusterIdRequest struct { ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } func (x *CountAllUpgradeHTTPDNSNodesWithClusterIdRequest) Reset() { *x = CountAllUpgradeHTTPDNSNodesWithClusterIdRequest{} } func (x *CountAllUpgradeHTTPDNSNodesWithClusterIdRequest) String() string { return fmt.Sprintf("%+v", *x) } func (x *CountAllUpgradeHTTPDNSNodesWithClusterIdRequest) ProtoMessage() {} func (x *CountAllUpgradeHTTPDNSNodesWithClusterIdRequest) GetClusterId() int64 { if x != nil { return x.ClusterId } return 0 } func (x *CountAllUpgradeHTTPDNSNodesWithClusterIdRequest) Marshal() ([]byte, error) { var b []byte if x.ClusterId != 0 { b = protowire.AppendTag(b, 1, protowire.VarintType) b = protowire.AppendVarint(b, uint64(x.ClusterId)) } return b, nil } func (x *CountAllUpgradeHTTPDNSNodesWithClusterIdRequest) Unmarshal(data []byte) error { for len(data) > 0 { num, typ, n := protowire.ConsumeTag(data) if n < 0 { return fmt.Errorf("invalid tag") } data = data[n:] switch num { case 1: if typ == protowire.VarintType { v, n := protowire.ConsumeVarint(data) if n < 0 { return fmt.Errorf("invalid varint") } x.ClusterId = int64(v) data = data[n:] } default: n := protowire.ConsumeFieldValue(num, typ, data) if n < 0 { return fmt.Errorf("invalid field value") } data = data[n:] } } return nil } // FindAllUpgradeHTTPDNSNodesWithClusterIdRequest 列出所有需要升级的HTTPDNS节点 type FindAllUpgradeHTTPDNSNodesWithClusterIdRequest struct { ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdRequest) Reset() { *x = FindAllUpgradeHTTPDNSNodesWithClusterIdRequest{} } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdRequest) String() string { return fmt.Sprintf("%+v", *x) } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdRequest) ProtoMessage() {} func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdRequest) GetClusterId() int64 { if x != nil { return x.ClusterId } return 0 } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdRequest) Marshal() ([]byte, error) { var b []byte if x.ClusterId != 0 { b = protowire.AppendTag(b, 1, protowire.VarintType) b = protowire.AppendVarint(b, uint64(x.ClusterId)) } return b, nil } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdRequest) Unmarshal(data []byte) error { for len(data) > 0 { num, typ, n := protowire.ConsumeTag(data) if n < 0 { return fmt.Errorf("invalid tag") } data = data[n:] switch num { case 1: if typ == protowire.VarintType { v, n := protowire.ConsumeVarint(data) if n < 0 { return fmt.Errorf("invalid varint") } x.ClusterId = int64(v) data = data[n:] } default: n := protowire.ConsumeFieldValue(num, typ, data) if n < 0 { return fmt.Errorf("invalid field value") } data = data[n:] } } return nil } // FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade 单个待升级节点信息 type FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade struct { Node *HTTPDNSNode `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` Os string `protobuf:"bytes,2,opt,name=os,proto3" json:"os,omitempty"` Arch string `protobuf:"bytes,3,opt,name=arch,proto3" json:"arch,omitempty"` OldVersion string `protobuf:"bytes,4,opt,name=oldVersion,proto3" json:"oldVersion,omitempty"` NewVersion string `protobuf:"bytes,5,opt,name=newVersion,proto3" json:"newVersion,omitempty"` } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade) Reset() { *x = FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade{} } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade) String() string { return fmt.Sprintf("%+v", *x) } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade) ProtoMessage() {} func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade) Marshal() ([]byte, error) { var b []byte if x.Node != nil { nodeData, err := proto.Marshal(x.Node) if err != nil { return nil, err } b = protowire.AppendTag(b, 1, protowire.BytesType) b = protowire.AppendBytes(b, nodeData) } if x.Os != "" { b = protowire.AppendTag(b, 2, protowire.BytesType) b = protowire.AppendString(b, x.Os) } if x.Arch != "" { b = protowire.AppendTag(b, 3, protowire.BytesType) b = protowire.AppendString(b, x.Arch) } if x.OldVersion != "" { b = protowire.AppendTag(b, 4, protowire.BytesType) b = protowire.AppendString(b, x.OldVersion) } if x.NewVersion != "" { b = protowire.AppendTag(b, 5, protowire.BytesType) b = protowire.AppendString(b, x.NewVersion) } return b, nil } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade) Unmarshal(data []byte) error { for len(data) > 0 { num, typ, n := protowire.ConsumeTag(data) if n < 0 { return fmt.Errorf("invalid tag") } data = data[n:] switch num { case 1: if typ == protowire.BytesType { v, n := protowire.ConsumeBytes(data) if n < 0 { return fmt.Errorf("invalid bytes") } x.Node = &HTTPDNSNode{} if err := proto.Unmarshal(v, x.Node); err != nil { return err } data = data[n:] } case 2: if typ == protowire.BytesType { v, n := protowire.ConsumeString(data) if n < 0 { return fmt.Errorf("invalid string") } x.Os = v data = data[n:] } case 3: if typ == protowire.BytesType { v, n := protowire.ConsumeString(data) if n < 0 { return fmt.Errorf("invalid string") } x.Arch = v data = data[n:] } case 4: if typ == protowire.BytesType { v, n := protowire.ConsumeString(data) if n < 0 { return fmt.Errorf("invalid string") } x.OldVersion = v data = data[n:] } case 5: if typ == protowire.BytesType { v, n := protowire.ConsumeString(data) if n < 0 { return fmt.Errorf("invalid string") } x.NewVersion = v data = data[n:] } default: n := protowire.ConsumeFieldValue(num, typ, data) if n < 0 { return fmt.Errorf("invalid field value") } data = data[n:] } } return nil } // FindAllUpgradeHTTPDNSNodesWithClusterIdResponse 列出所有需要升级的HTTPDNS节点 type FindAllUpgradeHTTPDNSNodesWithClusterIdResponse struct { Nodes []*FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse) Reset() { *x = FindAllUpgradeHTTPDNSNodesWithClusterIdResponse{} } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse) String() string { return fmt.Sprintf("%+v", *x) } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse) ProtoMessage() {} func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse) GetNodes() []*FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade { if x != nil { return x.Nodes } return nil } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse) Marshal() ([]byte, error) { var b []byte for _, node := range x.Nodes { nodeData, err := node.Marshal() if err != nil { return nil, err } b = protowire.AppendTag(b, 1, protowire.BytesType) b = protowire.AppendBytes(b, nodeData) } return b, nil } func (x *FindAllUpgradeHTTPDNSNodesWithClusterIdResponse) Unmarshal(data []byte) error { for len(data) > 0 { num, typ, n := protowire.ConsumeTag(data) if n < 0 { return fmt.Errorf("invalid tag") } data = data[n:] switch num { case 1: if typ == protowire.BytesType { v, n := protowire.ConsumeBytes(data) if n < 0 { return fmt.Errorf("invalid bytes") } node := &FindAllUpgradeHTTPDNSNodesWithClusterIdResponse_HTTPDNSNodeUpgrade{} if err := node.Unmarshal(v); err != nil { return err } x.Nodes = append(x.Nodes, node) data = data[n:] } default: n := protowire.ConsumeFieldValue(num, typ, data) if n < 0 { return fmt.Errorf("invalid field value") } data = data[n:] } } return nil } // UpgradeHTTPDNSNodeRequest 升级单个HTTPDNS节点 type UpgradeHTTPDNSNodeRequest struct { NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` } func (x *UpgradeHTTPDNSNodeRequest) Reset() { *x = UpgradeHTTPDNSNodeRequest{} } func (x *UpgradeHTTPDNSNodeRequest) String() string { return fmt.Sprintf("%+v", *x) } func (x *UpgradeHTTPDNSNodeRequest) ProtoMessage() {} func (x *UpgradeHTTPDNSNodeRequest) GetNodeId() int64 { if x != nil { return x.NodeId } return 0 } func (x *UpgradeHTTPDNSNodeRequest) Marshal() ([]byte, error) { var b []byte if x.NodeId != 0 { b = protowire.AppendTag(b, 1, protowire.VarintType) b = protowire.AppendVarint(b, uint64(x.NodeId)) } return b, nil } func (x *UpgradeHTTPDNSNodeRequest) Unmarshal(data []byte) error { for len(data) > 0 { num, typ, n := protowire.ConsumeTag(data) if n < 0 { return fmt.Errorf("invalid tag") } data = data[n:] switch num { case 1: if typ == protowire.VarintType { v, n := protowire.ConsumeVarint(data) if n < 0 { return fmt.Errorf("invalid varint") } x.NodeId = int64(v) data = data[n:] } default: n := protowire.ConsumeFieldValue(num, typ, data) if n < 0 { return fmt.Errorf("invalid field value") } data = data[n:] } } return nil }