summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2018-08-02 10:12:17 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2018-08-02 10:12:17 +0800
commitf68cc86f0733965297348ce0b7cf1f772da802f0 (patch)
treece5aeab6eed808048f524e18c95904ae22b8af90
parent933e3c6f0ce1640c7d00d70c929266603136cb3b (diff)
define msb data struct
Issue-ID: MSB-249 Change-Id: I4e5cc8ff14f13c315960f3203162b633c4169cdd Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
-rw-r--r--msb2pilot/src/msb2pilot/models/msb.go65
1 files changed, 65 insertions, 0 deletions
diff --git a/msb2pilot/src/msb2pilot/models/msb.go b/msb2pilot/src/msb2pilot/models/msb.go
new file mode 100644
index 0000000..09418e7
--- /dev/null
+++ b/msb2pilot/src/msb2pilot/models/msb.go
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2018 ZTE Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * ZTE - initial Project
+ */
+package models
+
+type Protocol string
+
+const (
+ Protocol_UI Protocol = "UI"
+ Protocol_REST Protocol = "REST"
+ Protocol_HTTP Protocol = "HTTP"
+ Protocol_MQ Protocol = "MQ"
+ Protocol_FTP Protocol = "FTP"
+ Protocol_SNMP Protocol = "SNMP"
+ Protocol_TCP Protocol = "TCP"
+ Protocol_UDP Protocol = "UDP"
+)
+
+type BaseInfo struct {
+ Path string `json:"path",omitempty`
+ VisualRange string `json:"visualRange"`
+ AppVersion string `json:"appversion"`
+ PublishPort string `json:"publish_port"`
+ EnableSSL string `json:"enable_ssl",omitempty`
+ IsManual string `json:"is_manual"`
+ Protocol Protocol `json:"protocol"`
+ ServiceStatus string `json:"status,omitempty"`
+ Version string `json:"version"`
+ Url string `json:"url"`
+}
+
+type NameSpace struct {
+ NameSpace string `json:"namespace"`
+}
+
+type ConsulLabels struct {
+ NameSpace *NameSpace
+ BaseInfo *BaseInfo
+}
+
+type MsbService struct {
+ ConsulLabels *ConsulLabels
+ ServiceName string
+ ServiceAddress string
+ ServicePort int
+ ModifyIndex uint64
+}
+
+type PublishService struct {
+ ServiceName string `json:"serviceName"`
+ Version string `json:"version",omitempty`
+ PublishPort string `json:"publish_port",omitempty`
+ Protocol string `json:"protocol",omitempty`
+ NameSpace string `json:"namespace",omitempty`
+ PublishUrl string `json:"publish_url",omitempty`
+ PublishProtocol string `json:"publish_protocol",omitempty`
+}