Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrGatewayNotFound should be used when a gateway can't be found in the Kubernetes cluster. ErrGatewayNotFound = errors.New("Could not find the specifed GatewayApi resource in Kubernetes") // ErrServiceNotFound should be used when a service resource cannot be found in the Kubernetes cluster. ErrServiceNotFound = errors.New("Could not find the specified v1.Service resources in Kubernetes") )
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Type string `json:"type"` Object GatewayApi `json:"object"` }
Event provides the event recieved for gateway api resource watchers.
type GACopy ¶
type GACopy GatewayApi
GACopy provides an alias of the GatewayApi to be utilised in unmarshalling of JSON data.
type GatewayApi ¶
type GatewayApi struct { unversioned.TypeMeta `json:",inline"` Metadata api.ObjectMeta `json:"metadata"` Spec Spec `json:"spec"` }
GatewayApi provides the type for an API plugin resource in Kubernetes.
func (*GatewayApi) GetObjectKind ¶
func (p *GatewayApi) GetObjectKind() unversioned.ObjectKind
GetObjectKind provides the method to expose the kind of our GatewayApi object.
func (*GatewayApi) GetObjectMeta ¶
func (p *GatewayApi) GetObjectMeta() meta.Object
GetObjectMeta Retrieves the metadata for the GatewayApi.
func (*GatewayApi) UnmarshalJSON ¶
func (p *GatewayApi) UnmarshalJSON(data []byte) error
UnmarshalJSON provides the way in which JSON should be unmarshalled correctly for this type. This is a temporary workaround for https://github.com/kubernetes/client-go/issues/8
type GatewayApiList ¶
type GatewayApiList struct { unversioned.TypeMeta `json:",inline"` Metadata unversioned.ListMeta `json:"metadata"` Items []GatewayApi `json:"items"` }
GatewayApiList provides the type encapsulating a list of GatewayApi resources.
func (*GatewayApiList) GetListMeta ¶
func (l *GatewayApiList) GetListMeta() unversioned.List
GetListMeta Retrieves the metadata for the GatewayApi List.
func (*GatewayApiList) GetObjectKind ¶
func (l *GatewayApiList) GetObjectKind() unversioned.ObjectKind
GetObjectKind provides the method to expose the kind of our GatewayApi List object.
func (*GatewayApiList) UnmarshalJSON ¶
func (l *GatewayApiList) UnmarshalJSON(data []byte) error
UnmarshalJSON provides the way in which JSON should be unmarshalled correctly for this list type. Temporary workaround for https://github.com/kubernetes/client-go/issues/8
type ListCopy ¶
type ListCopy GatewayApiList
ListCopy provides the type alias for list to be used in unmarshalling from JSON.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service deals with monitoring and responding to events on gateway api resources in k8s and updating the Kong representations accordingly.
func NewService ¶
func NewService(k8sRestClient *rest.RESTClient, k8sClient *k8sclient.Client, kong *kong.Client, namespace string, apiLabel string, serviceSelectorLabel string) *Service
NewService creates a new instance of the GatewayApi service.
type Spec ¶
type Spec struct { Hosts []string `json:"hosts,omitempty"` Uris []string `json:"uris,omitempty"` StripURI *bool `json:"strip_uri,omitempty"` Methods []string `json:"methods,omitempty"` PreserveHost *bool `json:"preserve_host,omitempty"` Retries int64 `json:"retries,omitempty"` UpstreamConnectTimeout int64 `json:"upstream_connect_timeout,omitempty"` UpstreamSendTimeout int64 `json:"upstream_send_timeout,omitempty"` UpstreamReadTimeout int64 `json:"upstream_read_timeout,omitempty"` HTTPSOnly *bool `json:"https_only,omitempty"` HTTPIfTerminated *bool `json:"http_if_terminated,omitempty"` // Label selector for selecting the services the GatewayApi resource // represents. This will then create a new API object // in Kong for the configuration and service upstream host. Selector map[string]string `json:"selector"` }
Spec provides the type for the specification of the plugin resource specification. The name and upstream url of the API to be created in kong are taken from the service in the selector.
type UpdateEvent ¶
type UpdateEvent struct { Old GatewayApi `json:"old"` New GatewayApi `json:"new"` }
UpdateEvent provides the event recieved for gateway api resource watchers for update events specifically.