Documentation ¶
Overview ¶
Copyright 2021 Red Hat, Inc.
Licensed 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.
Copyright 2021 Red Hat, Inc.
Licensed 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.
Copyright 2021 Red Hat, Inc.
Licensed 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 ¶
- Variables
- func BasePathFromOpenAPI(obj *openapi3.T) (string, error)
- func CheckDeploymentAvailable(ctx context.Context, k8sClient client.Client, key types.NamespacedName) (bool, error)
- func CreateOnlyK8SObject(k8sClient client.Client, obj runtime.Object) error
- func CreateOrUpdateK8SObject(k8sClient client.Client, obj runtime.Object) error
- func DeleteK8SObject(k8sClient client.Client, obj runtime.Object) error
- func FirstServerFromOpenAPI(obj *openapi3.T) *openapi3.Server
- func IsDeploymentAvailable(dc *appsv1.Deployment) bool
- func MergeMaps[K comparable, V any](MyMap1 map[K]V, MyMap2 map[K]V) map[K]V
- func OpenAPIMatcherFromOASOperations(basePath, path string, pathItem *openapi3.PathItem, verb string, ...) gatewayapiv1beta1.HTTPRouteMatch
- func OpenAPIOperationName(path, opVerb string, op *openapi3.Operation) string
- func ParseURL(str string) (*url.URL, bool)
- func ReadExternalResource(resource string) ([]byte, error)
- func ReadURL(location *url.URL) ([]byte, error)
- func RenderOpenAPIServerURL(server *openapi3.Server) (*url.URL, error)
- func RenderOpenAPIServerURLStr(server *openapi3.Server) (string, error)
- func SetupScheme() error
- type KuadrantOASInfoExtension
- type KuadrantOASOperationExtension
- type KuadrantOASPathExtension
- type KuadrantRateLimitExtension
- type RouteObject
Constants ¶
This section is empty.
Variables ¶
var ( // NonWordCharRegexp not word characters (== [^0-9A-Za-z_]) NonWordCharRegexp = regexp.MustCompile(`\W`) // TemplateRegexp used to render openapi server URLs TemplateRegexp = regexp.MustCompile(`{([\w]+)}`) // LastSlashRegexp matches the last slash LastSlashRegexp = regexp.MustCompile(`/$`) )
Functions ¶
func BasePathFromOpenAPI ¶ added in v0.2.0
func CreateOnlyK8SObject ¶
func CreateOrUpdateK8SObject ¶
func FirstServerFromOpenAPI ¶ added in v0.2.0
func IsDeploymentAvailable ¶
func IsDeploymentAvailable(dc *appsv1.Deployment) bool
IsDeploymentAvailable returns true when the provided Deployment has the "Available" condition set to true
func MergeMaps ¶ added in v0.2.0
func MergeMaps[K comparable, V any](MyMap1 map[K]V, MyMap2 map[K]V) map[K]V
func OpenAPIMatcherFromOASOperations ¶ added in v0.2.0
func OpenAPIMatcherFromOASOperations(basePath, path string, pathItem *openapi3.PathItem, verb string, op *openapi3.Operation, pathMatchType gatewayapiv1beta1.PathMatchType) gatewayapiv1beta1.HTTPRouteMatch
func OpenAPIOperationName ¶ added in v0.2.0
func ReadExternalResource ¶
ReadExternalResource reads data streams from external resources. Currently implemented: - '-' or '@' for STDIN - URLs (HTTP[S]) - Files
func RenderOpenAPIServerURL ¶ added in v0.2.0
func RenderOpenAPIServerURLStr ¶ added in v0.2.0
func SetupScheme ¶
func SetupScheme() error
Types ¶
type KuadrantOASInfoExtension ¶ added in v0.2.0
type KuadrantOASInfoExtension struct {
Route *RouteObject `json:"route,omitempty"`
}
func NewKuadrantOASInfoExtension ¶ added in v0.2.0
func NewKuadrantOASInfoExtension(info *openapi3.Info) (*KuadrantOASInfoExtension, error)
type KuadrantOASOperationExtension ¶ added in v0.2.0
type KuadrantOASOperationExtension KuadrantOASPathExtension
func NewKuadrantOASOperationExtension ¶ added in v0.2.0
func NewKuadrantOASOperationExtension(operation *openapi3.Operation) (*KuadrantOASOperationExtension, error)
type KuadrantOASPathExtension ¶ added in v0.2.0
type KuadrantOASPathExtension struct { Disable *bool `json:"disable,omitempty"` PathMatchType *gatewayapiv1beta1.PathMatchType `json:"pathMatchType,omitempty"` BackendRefs []gatewayapiv1beta1.HTTPBackendRef `json:"backendRefs,omitempty"` RateLimit *KuadrantRateLimitExtension `json:"rate_limit,omitempty"` }
func NewKuadrantOASPathExtension ¶ added in v0.2.0
func NewKuadrantOASPathExtension(pathItem *openapi3.PathItem) (*KuadrantOASPathExtension, error)
func (*KuadrantOASPathExtension) GetPathMatchType ¶ added in v0.2.0
func (k *KuadrantOASPathExtension) GetPathMatchType() gatewayapiv1beta1.PathMatchType
func (*KuadrantOASPathExtension) IsDisabled ¶ added in v0.2.0
func (k *KuadrantOASPathExtension) IsDisabled() bool
type KuadrantRateLimitExtension ¶ added in v0.2.0
type KuadrantRateLimitExtension struct { When []kuadrantapiv1beta2.WhenCondition `json:"when,omitempty"` Counters []kuadrantapiv1beta2.ContextSelector `json:"counters,omitempty"` Rates []kuadrantapiv1beta2.Rate `json:"rates,omitempty"` }
type RouteObject ¶ added in v0.2.0
type RouteObject struct { Name *string `json:"name,omitempty"` Namespace *string `json:"namespace,omitempty"` Hostnames []gatewayapiv1beta1.Hostname `json:"hostnames,omitempty"` ParentRefs []gatewayapiv1beta1.ParentReference `json:"parentRefs,omitempty"` Labels map[string]string `json:"labels,omitempty"` }