Dragonfly2
65 строк · 3.3 Кб
1/*
2* Copyright 2022 The Dragonfly Authors
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16
17package types18
19type PeerParams struct {20ID uint `uri:"id" binding:"required"`21}
22
23type CreatePeerRequest struct {24Hostname string `json:"host_name" binding:"required"`25Type string `json:"type" binding:"required,oneof=super strong weak normal"`26IDC string `json:"idc" binding:"omitempty"`27Location string `json:"location" binding:"omitempty"`28IP string `json:"ip" binding:"required"`29Port int32 `json:"port" binding:"required"`30DownloadPort int32 `json:"download_port" binding:"required"`31ObjectStoragePort int32 `json:"object_storage_port" binding:"omitempty"`32State string `json:"state" binding:"omitempty,oneof=active inactive"`33OS string `json:"os" binding:"omitempty"`34Platform string `json:"platform" binding:"omitempty"`35PlatformFamily string `json:"platform_family" binding:"omitempty"`36PlatformVersion string `json:"platform_version" binding:"omitempty"`37KernelVersion string `json:"kernel_version" binding:"omitempty"`38GitVersion string `json:"git_version" binding:"omitempty"`39GitCommit string `json:"git_commit" binding:"omitempty"`40BuildPlatform string `json:"build_platform" binding:"omitempty"`41SchedulerClusterID uint `json:"scheduler_cluster_id" binding:"required"`42}
43
44type GetPeersQuery struct {45Hostname string `form:"host_name" binding:"omitempty"`46Type string `form:"type" binding:"omitempty,oneof=super strong weak"`47IDC string `form:"idc" binding:"omitempty"`48Location string `form:"location" binding:"omitempty"`49IP string `form:"ip" binding:"omitempty"`50Port int32 `form:"port" binding:"omitempty"`51DownloadPort int32 `form:"download_port" binding:"omitempty"`52ObjectStoragePort int32 `form:"object_storage_port" binding:"omitempty"`53State string `form:"state" binding:"omitempty,oneof=active inactive"`54OS string `form:"os" binding:"omitempty"`55Platform string `form:"platform" binding:"omitempty"`56PlatformFamily string `form:"platform_family" binding:"omitempty"`57PlatformVersion string `form:"platform_version" binding:"omitempty"`58KernelVersion string `form:"kernel_version" binding:"omitempty"`59GitVersion string `form:"git_version" binding:"omitempty"`60GitCommit string `form:"git_commit" binding:"omitempty"`61BuildPlatform string `form:"build_platform" binding:"omitempty"`62SchedulerClusterID uint `form:"scheduler_cluster_id" binding:"omitempty"`63Page int `form:"page" binding:"omitempty,gte=1"`64PerPage int `form:"per_page" binding:"omitempty,gte=1,lte=10000000"`65}
66