Dragonfly2
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
17package models
18
19const (
20// SchedulerStateActive represents the scheduler whose state is active.
21SchedulerStateActive = "active"
22
23// SchedulerStateInactive represents the scheduler whose state is inactive.
24SchedulerStateInactive = "inactive"
25)
26
27type Scheduler struct {
28BaseModel
29Hostname string `gorm:"column:host_name;type:varchar(256);index:uk_scheduler,unique;not null;comment:hostname" json:"host_name"`
30IDC string `gorm:"column:idc;type:varchar(1024);comment:internet data center" json:"idc"`
31Location string `gorm:"column:location;type:varchar(1024);comment:location" json:"location"`
32IP string `gorm:"column:ip;type:varchar(256);index:uk_scheduler,unique;not null;comment:ip address" json:"ip"`
33Port int32 `gorm:"column:port;not null;comment:grpc service listening port" json:"port"`
34State string `gorm:"column:state;type:varchar(256);default:'inactive';comment:service state" json:"state"`
35Features Array `gorm:"column:features;comment:feature flags" json:"features"`
36SchedulerClusterID uint `gorm:"index:uk_scheduler,unique;not null;comment:scheduler cluster id" json:"scheduler_cluster_id"`
37SchedulerCluster SchedulerCluster `json:"scheduler_cluster"`
38Models []Model `json:"models"`
39}
40