apiplugin

package
v0.0.0-...-5bf65c3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2017 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APCopy

type APCopy ApiPlugin

APCopy provides an alias of the ApiPlugin to be utilised in unmarshalling of JSON data.

type ApiPlugin

type ApiPlugin struct {
	unversioned.TypeMeta `json:",inline"`
	Metadata             api.ObjectMeta `json:"metadata"`
	Spec                 Spec           `json:"spec"`
}

ApiPlugin provides the type for an API plugin resource in Kubernetes.

func (*ApiPlugin) GetObjectKind

func (p *ApiPlugin) GetObjectKind() unversioned.ObjectKind

GetObjectKind provides the method to expose the kind of our ApiPlugin object.

func (*ApiPlugin) GetObjectMeta

func (p *ApiPlugin) GetObjectMeta() meta.Object

GetObjectMeta Retrieves the metadata for the ApiPlugin.

func (*ApiPlugin) UnmarshalJSON

func (p *ApiPlugin) 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 ApiPluginList

type ApiPluginList struct {
	unversioned.TypeMeta `json:",inline"`
	Metadata             unversioned.ListMeta `json:"metadata"`
	Items                []ApiPlugin          `json:"items"`
}

ApiPluginList provides the type encapsulating a list of ApiPlugin resources.

func (*ApiPluginList) GetListMeta

func (l *ApiPluginList) GetListMeta() unversioned.List

GetListMeta Retrieves the metadata for the ApiPlugin List.

func (*ApiPluginList) GetObjectKind

func (l *ApiPluginList) GetObjectKind() unversioned.ObjectKind

GetObjectKind provides the method to expose the kind of our ApiPlugin List object.

func (*ApiPluginList) UnmarshalJSON

func (l *ApiPluginList) 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 Event

type Event struct {
	Type   string    `json:"type"`
	Object ApiPlugin `json:"object"`
}

Event provides the event recieved for plugin resource watchers.

type ListCopy

type ListCopy ApiPluginList

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 api plugin 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, pluginServiceSelectorLabel string) *Service

NewService creates a new instance of the ApiPlugin service.

func (*Service) Start

func (s *Service) Start(doneChan <-chan struct{}, wg *sync.WaitGroup)

Start deals with beginning the monitoring process which deals with monitoring events from k8s apiplugin resources as well as services to propogate changes to kong. This method should be called asynchronously in it's own goroutine.

type Spec

type Spec struct {
	// The name of the plugin to be attached to a specified
	// k8s service that also represents a Kong API object.
	Name string `json:"name"`
	// Configuration for the plugin as expected by Kong.
	// Keys in this map should avoid the config. prefix
	// as will be automatically prepended when requests are made to Kong.
	Config map[string]interface{} `json:"config"`
	// Label selector for selecting the services the ApiPlugin resource
	// should be attached to. This will then create a new plugin on the API object
	// in Kong.
	Selector map[string]string `json:"selector"`
}

Spec provides the type for the specification of the plugin resource specification.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL