types

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Common

type Common struct {
	*config.Config
	*ListerInformer

	Elector *leaderelection.LeaderElector

	ControllerNamespace string

	APISIX           apisix.APISIX
	KubeClient       *kube.KubeClient
	MetricsCollector metrics.Collector
	Recorder         record.EventRecorder
}

func (*Common) RecordEvent

func (c *Common) RecordEvent(object runtime.Object, eventtype, reason string, err error)

RecordEvent recorder events for resources

func (*Common) RecordEventS

func (c *Common) RecordEventS(object runtime.Object, eventtype, reason string, msg string)

RecordEventS recorder events for resources

func (*Common) SyncClusterManifests

func (c *Common) SyncClusterManifests(ctx context.Context, clusterName string, added, updated, deleted *utils.Manifest, shouldCompare bool) error

TODO: support multiple cluster

func (*Common) SyncConsumer

func (c *Common) SyncConsumer(ctx context.Context, consumer *apisixv1.Consumer, event types.EventType) (err error)

func (*Common) SyncManifests

func (c *Common) SyncManifests(ctx context.Context, added, updated, deleted *utils.Manifest, shouldCompare bool) error

TODO: Move sync utils to apisix.APISIX interface?

func (*Common) SyncPluginMetadata

func (c *Common) SyncPluginMetadata(ctx context.Context, pm *apisixv1.PluginMetadata, event types.EventType) (err error)

func (*Common) SyncSSL

func (c *Common) SyncSSL(ctx context.Context, ssl *apisixv1.Ssl, event types.EventType) error

func (*Common) SyncUpstreamNodesChangeToCluster

func (c *Common) SyncUpstreamNodesChangeToCluster(ctx context.Context, cluster apisix.Cluster, nodes apisixv1.UpstreamNodes, upsName string) error

type ListerInformer

type ListerInformer struct {
	KubeFactory   informers.SharedInformerFactory
	ApisixFactory externalversions.SharedInformerFactory

	NamespaceInformer cache.SharedIndexInformer
	NamespaceLister   listerscorev1.NamespaceLister

	EpLister   kube.EndpointLister
	EpInformer cache.SharedIndexInformer

	SvcLister   listerscorev1.ServiceLister
	SvcInformer cache.SharedIndexInformer

	SecretLister   listerscorev1.SecretLister
	SecretInformer cache.SharedIndexInformer

	PodLister   listerscorev1.PodLister
	PodInformer cache.SharedIndexInformer

	ConfigMapLister   listerscorev1.ConfigMapLister
	ConfigMapInformer cache.SharedIndexInformer

	IngressLister   kube.IngressLister
	IngressInformer cache.SharedIndexInformer

	ApisixUpstreamInformer      cache.SharedIndexInformer
	ApisixRouteInformer         cache.SharedIndexInformer
	ApisixPluginConfigInformer  cache.SharedIndexInformer
	ApisixConsumerInformer      cache.SharedIndexInformer
	ApisixTlsInformer           cache.SharedIndexInformer
	ApisixClusterConfigInformer cache.SharedIndexInformer
	ApisixGlobalRuleInformer    cache.SharedIndexInformer

	ApisixRouteLister         kube.ApisixRouteLister
	ApisixUpstreamLister      kube.ApisixUpstreamLister
	ApisixPluginConfigLister  kube.ApisixPluginConfigLister
	ApisixConsumerLister      kube.ApisixConsumerLister
	ApisixTlsLister           kube.ApisixTlsLister
	ApisixClusterConfigLister kube.ApisixClusterConfigLister
	ApisixGlobalRuleLister    kube.ApisixGlobalRuleLister
}

func (*ListerInformer) StartAndWaitForCacheSync

func (c *ListerInformer) StartAndWaitForCacheSync(ctx context.Context) bool

type Provider

type Provider interface {
	// Init() // TODO: should all provider implement this?
	Run(ctx context.Context)
}

Jump to

Keyboard shortcuts

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