2019-02-24 05:13:54 +08:00
|
|
|
// Copyright (C) 2014-2018 Goodrain Co., Ltd.
|
|
|
|
// RAINBOND, Application Management Platform
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version. For any non-GPL usage of Rainbond,
|
|
|
|
// one or multiple Commercial Licenses authorized by Goodrain Co., Ltd.
|
|
|
|
// must be obtained first.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
package model
|
|
|
|
|
|
|
|
// Endpoint is a persistent object for table 3rd_party_svc_endpoints.
|
|
|
|
type Endpoint struct {
|
|
|
|
Model
|
2019-03-14 11:12:17 +08:00
|
|
|
UUID string `gorm:"column:uuid;size:32" json:"uuid"`
|
|
|
|
ServiceID string `gorm:"column:service_id;size:32;not null" json:"service_id"`
|
2019-02-28 11:50:54 +08:00
|
|
|
IP string `gorm:"column:ip;not null" json:"ip"`
|
|
|
|
Port int `gorm:"column:port;size:65535" json:"port"`
|
2019-02-27 00:26:55 +08:00
|
|
|
//use pointer type, zero values won't be saved into database
|
2019-02-28 11:50:54 +08:00
|
|
|
IsOnline *bool `gorm:"column:is_online;default:true" json:"is_online"`
|
2019-02-24 05:13:54 +08:00
|
|
|
}
|
|
|
|
|
2019-02-25 01:07:37 +08:00
|
|
|
// TableName returns table name of Endpoint.
|
2019-02-24 05:13:54 +08:00
|
|
|
func (Endpoint) TableName() string {
|
2019-02-25 10:57:01 +08:00
|
|
|
return "tenant_service_3rd_party_endpoints"
|
2019-02-24 05:13:54 +08:00
|
|
|
}
|
2019-02-24 21:10:13 +08:00
|
|
|
|
2019-03-08 14:46:11 +08:00
|
|
|
// DiscorveryType type of service discovery center.
|
|
|
|
type DiscorveryType string
|
|
|
|
|
|
|
|
// DiscorveryTypeEtcd etcd
|
|
|
|
var DiscorveryTypeEtcd DiscorveryType = "etcd"
|
|
|
|
|
|
|
|
func (d DiscorveryType) String() string {
|
|
|
|
return string(d)
|
|
|
|
}
|
|
|
|
|
2019-02-28 11:50:54 +08:00
|
|
|
// ThirdPartySvcDiscoveryCfg s a persistent object for table
|
2019-02-25 01:07:37 +08:00
|
|
|
// 3rd_party_svc_discovery_cfg. 3rd_party_svc_discovery_cfg contains
|
|
|
|
// service discovery center configuration for third party service.
|
2019-02-28 11:50:54 +08:00
|
|
|
type ThirdPartySvcDiscoveryCfg struct {
|
2019-02-25 01:07:37 +08:00
|
|
|
Model
|
|
|
|
ServiceID string `gorm:"column:service_id;size:32"`
|
|
|
|
Type string `gorm:"column:type"`
|
|
|
|
Servers string `gorm:"column:servers"`
|
|
|
|
Key string `gorm:"key"`
|
|
|
|
Username string `gorm:"username"`
|
|
|
|
Password string `gorm:"password"`
|
|
|
|
}
|
|
|
|
|
2019-02-28 11:50:54 +08:00
|
|
|
// TableName returns table name of ThirdPartySvcDiscoveryCfg.
|
|
|
|
func (ThirdPartySvcDiscoveryCfg) TableName() string {
|
2019-02-25 10:57:01 +08:00
|
|
|
return "tenant_service_3rd_party_discovery_cfg"
|
2019-02-27 00:26:55 +08:00
|
|
|
}
|