translation

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: 32 Imported by: 1

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.

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

func SafeEncodeString added in v1.8.1

func SafeEncodeString(s string, limit int) string

This reduces the chances of bad words and ensures that strings generated from hash functions appear consistent throughout the API. The returned string doesn't exceed the size limit

Types

type Ingress

type Ingress struct {
	Plugins          apisix.Plugins
	UseRegex         bool
	EnableWebSocket  bool
	PluginConfigName string
	ServiceNamespace string
	Upstream         upstream.Upstream
}

Structure extracted by Ingress Resource

type IngressTranslator

type IngressTranslator interface {
	// TranslateIngress composes a couple of APISIX Routes and upstreams according
	// to the given Ingress resource.
	// For old objects, you cannot use TranslateIngress to build. Because it needs to parse the latest service, which will cause data inconsistency.
	TranslateIngress(ing kube.Ingress, args ...bool) (*translation.TranslateContext, error)
	// TranslateOldIngress get route objects from cache
	// Build upstream and plugin_config through route
	TranslateOldIngress(kube.Ingress) (*translation.TranslateContext, error)
	// TranslateSSLV2 translate networkingv1.IngressTLS to APISIX SSL
	TranslateIngressTLS(namespace, ingName, secretName string, hosts []string) (*apisixv1.Ssl, error)
	// TranslateIngressDeleteEvent composes a couple of APISIX Routes and upstreams according
	// to the given Ingress resource.
	TranslateIngressDeleteEvent(ing kube.Ingress, args ...bool) (*translation.TranslateContext, error)
}

func NewIngressTranslator

func NewIngressTranslator(opts *TranslatorOptions,
	commonTranslator translation.Translator, apisixTranslator apisixtranslation.ApisixTranslator) IngressTranslator

type TranslatorOptions

type TranslatorOptions struct {
	Apisix      apisix.APISIX
	ClusterName string

	ServiceLister listerscorev1.ServiceLister
}

Directories

Path Synopsis
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
pluginconfig
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
plugins
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
regex
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
servicenamespace
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
upstream
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
websocket
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.

Jump to

Keyboard shortcuts

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