Dragonfly2

Форк
0
/
scheduler.go 
39 строк · 2.0 Кб
1
/*
2
 *     Copyright 2020 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 models
18

19
const (
20
	// SchedulerStateActive represents the scheduler whose state is active.
21
	SchedulerStateActive = "active"
22

23
	// SchedulerStateInactive represents the scheduler whose state is inactive.
24
	SchedulerStateInactive = "inactive"
25
)
26

27
type Scheduler struct {
28
	BaseModel
29
	Hostname           string           `gorm:"column:host_name;type:varchar(256);index:uk_scheduler,unique;not null;comment:hostname" json:"host_name"`
30
	IDC                string           `gorm:"column:idc;type:varchar(1024);comment:internet data center" json:"idc"`
31
	Location           string           `gorm:"column:location;type:varchar(1024);comment:location" json:"location"`
32
	IP                 string           `gorm:"column:ip;type:varchar(256);index:uk_scheduler,unique;not null;comment:ip address" json:"ip"`
33
	Port               int32            `gorm:"column:port;not null;comment:grpc service listening port" json:"port"`
34
	State              string           `gorm:"column:state;type:varchar(256);default:'inactive';comment:service state" json:"state"`
35
	Features           Array            `gorm:"column:features;comment:feature flags" json:"features"`
36
	SchedulerClusterID uint             `gorm:"index:uk_scheduler,unique;not null;comment:scheduler cluster id"  json:"scheduler_cluster_id"`
37
	SchedulerCluster   SchedulerCluster `json:"scheduler_cluster"`
38
	Models             []Model          `json:"models"`
39
}
40

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

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

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

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