-
Notifications
You must be signed in to change notification settings - Fork 124
/
ingress.go
89 lines (74 loc) · 1.95 KB
/
ingress.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//
// Last.Backend LLC CONFIDENTIAL
// __________________
//
// [2014] - [2018] Last.Backend LLC
// All Rights Reserved.
//
// NOTICE: All information contained herein is, and remains
// the property of Last.Backend LLC and its suppliers,
// if any. The intellectual and technical concepts contained
// herein are proprietary to Last.Backend LLC
// and its suppliers and may be covered by Russian Federation and Foreign Patents,
// patents in process, and are protected by trade secret or copyright law.
// Dissemination of this information or reproduction of this material
// is strictly forbidden unless prior written permission is obtained
// from Last.Backend LLC.
//
package types
import "fmt"
// swagger:ignore
type Ingress struct {
Runtime
Meta IngressMeta `json:"meta"`
Status IngressStatus `json:"status"`
Spec IngressSpec `json:"spec"`
}
type IngressList struct {
Runtime
Items []*Ingress
}
type IngressMap struct {
Runtime
Items map[string]*Ingress
}
// swagger:ignore
type IngressMeta struct {
Meta
Node string `json:"node"`
}
type IngressInfo struct {
Type string `json:"type"`
Version string `json:"version"`
Hostname string `json:"hostname"`
Architecture string `json:"architecture"`
OSName string `json:"os_name"`
OSType string `json:"os_type"`
// RewriteIP - need to set true if you want to use an external ip
ExternalIP string `json:"external_ip"`
InternalIP string `json:"internal_ip"`
}
// swagger:model types_ingress_status
type IngressStatus struct {
Ready bool `json:"ready"`
Online bool `json:"online"`
}
type IngressSpec struct {
}
// swagger:ignore
func (n *Ingress) SelfLink() string {
if n.Meta.SelfLink == "" {
n.Meta.SelfLink = fmt.Sprintf("%s", n.Meta.Name)
}
return n.Meta.SelfLink
}
func NewIngressList() *IngressList {
dm := new(IngressList)
dm.Items = make([]*Ingress, 0)
return dm
}
func NewIngressMap() *IngressMap {
dm := new(IngressMap)
dm.Items = make(map[string]*Ingress)
return dm
}