-
Notifications
You must be signed in to change notification settings - Fork 243
/
types.go
44 lines (37 loc) · 1.17 KB
/
types.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
package url
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// URL is
type URL struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec URLSpec `json:"spec,omitempty"`
Status URLStatus `json:"status,omitempty"`
}
// URLSpec is
type URLSpec struct {
Host string `json:"host,omitempty"`
Protocol string `json:"protocol,omitempty"`
Port int `json:"port,omitempty"`
}
// AppList is a list of applications
type URLList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []URL `json:"items"`
}
// URLStatus is Status of url
type URLStatus struct {
// "Pushed" or "Not Pushed" or "Locally Delted"
State StateType `json:"state"`
}
type StateType string
const (
// StateTypePushed means that URL is present both locally and on cluster
StateTypePushed = "Pushed"
// StateTypeNotPushed means that URL is only in local config, but not on the cluster
StateTypeNotPushed = "Not Pushed"
// StateTypeLocallyDeleted means that URL was deleted from the local config, but it is still present on the cluster
StateTypeLocallyDeleted = "Locally Deleted"
)