Dragonfly2

Форк
0
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

17
package types
18

19
type PeerParams struct {
20
	ID uint `uri:"id" binding:"required"`
21
}
22

23
type CreatePeerRequest struct {
24
	Hostname           string `json:"host_name" binding:"required"`
25
	Type               string `json:"type" binding:"required,oneof=super strong weak normal"`
26
	IDC                string `json:"idc" binding:"omitempty"`
27
	Location           string `json:"location" binding:"omitempty"`
28
	IP                 string `json:"ip" binding:"required"`
29
	Port               int32  `json:"port" binding:"required"`
30
	DownloadPort       int32  `json:"download_port" binding:"required"`
31
	ObjectStoragePort  int32  `json:"object_storage_port" binding:"omitempty"`
32
	State              string `json:"state" binding:"omitempty,oneof=active inactive"`
33
	OS                 string `json:"os" binding:"omitempty"`
34
	Platform           string `json:"platform" binding:"omitempty"`
35
	PlatformFamily     string `json:"platform_family" binding:"omitempty"`
36
	PlatformVersion    string `json:"platform_version" binding:"omitempty"`
37
	KernelVersion      string `json:"kernel_version" binding:"omitempty"`
38
	GitVersion         string `json:"git_version" binding:"omitempty"`
39
	GitCommit          string `json:"git_commit" binding:"omitempty"`
40
	BuildPlatform      string `json:"build_platform" binding:"omitempty"`
41
	SchedulerClusterID uint   `json:"scheduler_cluster_id" binding:"required"`
42
}
43

44
type GetPeersQuery struct {
45
	Hostname           string `form:"host_name" binding:"omitempty"`
46
	Type               string `form:"type" binding:"omitempty,oneof=super strong weak"`
47
	IDC                string `form:"idc" binding:"omitempty"`
48
	Location           string `form:"location" binding:"omitempty"`
49
	IP                 string `form:"ip" binding:"omitempty"`
50
	Port               int32  `form:"port" binding:"omitempty"`
51
	DownloadPort       int32  `form:"download_port" binding:"omitempty"`
52
	ObjectStoragePort  int32  `form:"object_storage_port" binding:"omitempty"`
53
	State              string `form:"state" binding:"omitempty,oneof=active inactive"`
54
	OS                 string `form:"os" binding:"omitempty"`
55
	Platform           string `form:"platform" binding:"omitempty"`
56
	PlatformFamily     string `form:"platform_family" binding:"omitempty"`
57
	PlatformVersion    string `form:"platform_version" binding:"omitempty"`
58
	KernelVersion      string `form:"kernel_version" binding:"omitempty"`
59
	GitVersion         string `form:"git_version" binding:"omitempty"`
60
	GitCommit          string `form:"git_commit" binding:"omitempty"`
61
	BuildPlatform      string `form:"build_platform" binding:"omitempty"`
62
	SchedulerClusterID uint   `form:"scheduler_cluster_id" binding:"omitempty"`
63
	Page               int    `form:"page" binding:"omitempty,gte=1"`
64
	PerPage            int    `form:"per_page" binding:"omitempty,gte=1,lte=10000000"`
65
}
66

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.