Add version v0.1.0
[ric-plt/rtmgr.git] / pkg / rtmgr / types.go
1 /*
2 ==================================================================================
3   Copyright (c) 2019 AT&T Intellectual Property.
4   Copyright (c) 2019 Nokia
5
6    Licensed under the Apache License, Version 2.0 (the "License");
7    you may not use this file except in compliance with the License.
8    You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12    Unless required by applicable law or agreed to in writing, software
13    distributed under the License is distributed on an "AS IS" BASIS,
14    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15    See the License for the specific language governing permissions and
16    limitations under the License.
17 ==================================================================================
18 */
19 /*
20   Mnemonic:     rtmgr/types.go
21   Abstract:     Containes RTMGR (Routing Manager) specific types
22   Date:         12 March 2019
23 */
24
25 package rtmgr
26
27 type XApps struct {
28         XApplist []XApp
29 }
30
31 type RouteTable []RouteTableEntry
32 type EndpointList []Endpoint
33
34 type Endpoints map[string]*Endpoint
35
36 //TODO: uuid is not a real UUID but a string of "ip:port"
37 // this should be changed to real UUID later on which should come from xApp Manager // petszila
38 type Endpoint struct {
39         Uuid       string
40         Name       string
41         XAppType   string
42         Ip         string
43         Port       uint16
44         TxMessages []string
45         RxMessages []string
46         Socket     interface{}
47         IsReady    bool
48         Keepalive  bool
49 }
50
51 type RouteTableEntry struct {
52         MessageType string
53         TxList      EndpointList
54         RxGroups    []EndpointList
55 }
56
57 type XApp struct {
58         Name      string         `json:"name"`
59         Status    string         `json:"status"`
60         Version   string         `json:"version"`
61         Instances []XAppInstance `json:"instances"`
62 }
63
64 type XAppInstance struct {
65         Name       string   `json:"name"`
66         Status     string   `json:"status"`
67         Ip         string   `json:"ip"`
68         Port       uint16   `json:"port"`
69         TxMessages []string `json:"txMessages"`
70         RxMessages []string `json:"rxMessages"`
71 }