From 36c90b2cb7445b19fb7ac7f6c8ef0ee4dd757de9 Mon Sep 17 00:00:00 2001 From: wlan0 Date: Fri, 1 Dec 2017 23:44:51 -0800 Subject: [PATCH] add types for endpoint --- types/endpoints.go | 18 ++++++++++++------ types/objectRef.go | 11 +++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 types/objectRef.go diff --git a/types/endpoints.go b/types/endpoints.go index ed3a41c6..deaa8e6e 100644 --- a/types/endpoints.go +++ b/types/endpoints.go @@ -1,6 +1,6 @@ package types -/*type EndpointWrapper struct { +type EndpointWrapper struct { Endpoint Endpoint `json:"endpoint,omitempty"` } @@ -15,8 +15,14 @@ type EndpointSubset struct { } type EndpointAddress struct { - IP string - Hostname string - Nodename *string - Target -}*/ + IP string `json:"ip,omitempty"` + Hostname string `json:"hostname,omitempty"` + Nodename *string `json:"node,omitempty"` + Target *ObjectReference `json:"target,omitempty"` +} + +type EndpointPort struct { + Name string `json:"name,omitempty"` + Port int32 `json:"port,omitempty"` + Protocol Protocol `json:"protocol,omitempty"` +} diff --git a/types/objectRef.go b/types/objectRef.go new file mode 100644 index 00000000..489384a3 --- /dev/null +++ b/types/objectRef.go @@ -0,0 +1,11 @@ +package types + +type ObjectReference struct { + Kind string `json:"kind,omitempty"` + Namespace string `json:"namespace,omitempty"` + Name string `json:"name,omitempty"` + UID string `json:"uid,omitempty"` + APIVersion string `json:"version,omitempty"` + ResourceVersion string `json:"resource_version,omitempty"` + FieldPath string `json:"field_path,omitempty"` +}