kongstate

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ImplicitPort = "implicitPort"

Variables

This section is empty.

Functions

func SecretToConfiguration

func SecretToConfiguration(
	s store.Storer,
	reference configurationv1.SecretValueFromSource, namespace string) (
	configurationv1.Configuration, error)

Types

type Certificate

type Certificate struct {
	kong.Certificate
}

Certificate represents the certificate object in Kong.

type Consumer

type Consumer struct {
	kong.Consumer
	Plugins    []kong.Plugin
	KeyAuths   []*kong.KeyAuth
	HMACAuths  []*kong.HMACAuth
	JWTAuths   []*kong.JWTAuth
	BasicAuths []*kong.BasicAuth
	ACLGroups  []*kong.ACLGroup

	Oauth2Creds []*kong.Oauth2Credential

	K8sKongConsumer configurationv1.KongConsumer
}

Consumer holds a Kong consumer and its plugins and credentials.

func (*Consumer) SetCredential

func (c *Consumer) SetCredential(log logrus.FieldLogger, credType string, credConfig interface{}) error

type KongState

type KongState struct {
	Services       []Service
	Upstreams      []Upstream
	Certificates   []Certificate
	CACertificates []kong.CACertificate
	Plugins        []Plugin
	Consumers      []Consumer
}

KongState holds the configuration that should be applied to Kong.

func (*KongState) FillConsumersAndCredentials

func (ks *KongState) FillConsumersAndCredentials(log logrus.FieldLogger, s store.Storer)

func (*KongState) FillOverrides

func (ks *KongState) FillOverrides(log logrus.FieldLogger, s store.Storer)

func (*KongState) FillPlugins

func (ks *KongState) FillPlugins(log logrus.FieldLogger, s store.Storer)

type Plugin

type Plugin struct {
	kong.Plugin
}

Plugin represetns a plugin Object in Kong.

type PortDef

type PortDef struct {
	Mode PortMode

	// Name is the port name as stated in the Kubernetes service. Must be set iff Mode == PortModeName.
	Name string
	// Number is the port number. Must be set iff PortMode == PortModeNumber.
	Number int32
}

func (*PortDef) CanonicalString

func (p *PortDef) CanonicalString() string

type PortMode

type PortMode int
const (
	// PortModeImplicit means that the Ingress does not specify the Kubernetes Service port, and that KIC should expect
	// the Service to have only one port defined.
	PortModeImplicit PortMode = iota
	// PortModeNumber means that the Ingress specifies the Service port by raw port number.
	PortModeByNumber PortMode = iota
	// PortModeNumber means that the Ingress specifies the Service port by its name field.
	PortModeByName PortMode = iota
)

type Route

type Route struct {
	kong.Route

	Ingress util.K8sObjectInfo
	Plugins []kong.Plugin
}

Route represents a Kong Route and holds a reference to the Ingress rule.

type Service

type Service struct {
	kong.Service
	Backend    ServiceBackend
	Namespace  string
	Routes     []Route
	Plugins    []kong.Plugin
	K8sService corev1.Service
}

Service represents a service in Kong and holds routes associated with the service and other k8s metadata.

type ServiceBackend

type ServiceBackend struct {
	Name string
	Port PortDef
}

type Target

type Target struct {
	kong.Target
}

Target is a wrapper around Target object in Kong.

type Upstream

type Upstream struct {
	kong.Upstream
	Targets []Target
	// Service this upstream is asosciated with.
	Service Service
}

Upstream is a wrapper around Upstream object in Kong.

Jump to

Keyboard shortcuts

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