1package kuberesolver
2
3type EventType string
4
5const (
6	Added    EventType = "ADDED"
7	Modified EventType = "MODIFIED"
8	Deleted  EventType = "DELETED"
9	Error    EventType = "ERROR"
10)
11
12// Event represents a single event to a watched resource.
13type Event struct {
14	Type   EventType `json:"type"`
15	Object Endpoints `json:"object"`
16}
17
18type Endpoints struct {
19	Kind       string   `json:"kind"`
20	ApiVersion string   `json:"apiVersion"`
21	Metadata   Metadata `json:"metadata"`
22	Subsets    []Subset `json:"subsets"`
23}
24
25type Metadata struct {
26	Name            string            `json:"name"`
27	Namespace       string            `json:"namespace"`
28	ResourceVersion string            `json:"resourceVersion"`
29	Labels          map[string]string `json:"labels"`
30}
31
32type Subset struct {
33	Addresses []Address `json:"addresses"`
34	Ports     []Port    `json:"ports"`
35}
36
37type Address struct {
38	IP        string           `json:"ip"`
39	TargetRef *ObjectReference `json:"targetRef,omitempty"`
40}
41
42type ObjectReference struct {
43	Kind      string `json:"kind"`
44	Name      string `json:"name"`
45	Namespace string `json:"namespace"`
46}
47type Port struct {
48	Name string `json:"name"`
49	Port int    `json:"port"`
50}
51