Documentation
¶
Overview ¶
Package types provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Package types provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Package types provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Index ¶
- type BadRequest
- type DataplaneInbound
- type DataplaneOutbound
- type Error
- type FromRule
- type HttpMatch
- type Inbound
- type InboundPoliciesList
- type InboundPolicyConf
- type InboundRule
- type InboundRulesEntry
- type InspectRule
- type Internal
- type InvalidParameters
- type InvalidParametersSource
- type JsonPatchItem
- type JsonPatchItemOp
- type Meta
- type NotFound
- type NotFoundError
- type NotFoundErrorStatus
- type PoliciesList
- type PolicyConf
- type PolicyDescription
- type PolicyOrigin
- type PolicyRule
- type ProxyRule
- type ResourceRule
- type ResourceRuleOrigin
- type ResourceTypeDescription
- type ResourceTypeDescriptionScope
- type RouteConf
- type RouteRules
- type RoutesList
- type Rule
- type RuleMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadRequest ¶ added in v2.11.8
type BadRequest = Error
BadRequest Standard error. Follows the [AIP #193 - Errors](https://kong-aip.netlify.app/aip/193/) specification.
type DataplaneInbound ¶ added in v2.12.4
type DataplaneInbound struct {
Kri string `json:"kri"`
Port int32 `json:"port"`
Protocol string `json:"protocol"`
ProxyResourceName string `json:"proxyResourceName"`
}
DataplaneInbound defines model for DataplaneInbound.
type DataplaneOutbound ¶ added in v2.12.4
type DataplaneOutbound struct {
Kri string `json:"kri"`
Port int32 `json:"port"`
Protocol string `json:"protocol"`
ProxyResourceName string `json:"proxyResourceName"`
}
DataplaneOutbound defines model for DataplaneOutbound.
type Error ¶
type Error struct {
// Detail A human readable explanation specific to this occurrence of the problem.
// This field may contain request/entity data to help the user understand what went wrong.
// Enclose variable values in square brackets.
// _Should_ be provided as "Sentence case" for direct use in a UI
Detail string `json:"detail"`
// Instance Used to return the correlation ID back to the user, in the format `<app>:trace:<correlation_id>`.
Instance string `json:"instance"`
// InvalidParameters All 400 errors **MUST** return an `invalid_parameters` key in the response.
// Used to indicate which fields have invalid values when validated.
InvalidParameters *[]InvalidParameters `json:"invalid_parameters,omitempty"`
// Status The HTTP status code.
Status int `json:"status"`
// Title A short, human-readable summary of the problem.
// It **should not** change between occurrences of a problem, except for localization.
// Should be provided as "Sentence case" for potential direct use in a UI
Title string `json:"title"`
// Type A unique identifier for this error. When dereferenced it must provide human-readable documentation for the problem.
Type string `json:"type"`
}
Error Standard error. Follows the [AIP #193 - Errors](https://kong-aip.netlify.app/aip/193/) specification.
type HttpMatch ¶
type HttpMatch struct {
Hash string `json:"hash"`
Match interface{} `json:"match"`
}
HttpMatch defines model for HttpMatch.
type Inbound ¶
type Inbound struct {
Name *string `json:"name,omitempty"`
Port int `json:"port"`
Tags map[string]string `json:"tags"`
}
Inbound defines model for Inbound.
type InboundPoliciesList ¶ added in v2.12.4
type InboundPoliciesList struct {
// Policies The final computed configuration, derived by merging all policies whose 'targetRef' field matches the proxy. The merging process follows [RFC 7396 (JSON Merge Patch)](https://datatracker.ietf.org/doc/html/rfc7396), with the order of merging influenced by factors such as where the policy was applied (e.g., custom namespace, system, or global control plane), policy role, and targetRef specificity.
Policies []InboundPolicyConf `json:"policies"`
}
InboundPoliciesList defines model for InboundPoliciesList.
type InboundPolicyConf ¶ added in v2.12.4
type InboundPolicyConf struct {
Kind string `json:"kind"`
// Origins The list of policies KRI that contributed to the 'conf'. The order is important as it reflects in what order confs were merged to get the resulting 'conf'.
Origins []PolicyOrigin `json:"origins"`
Rules []PolicyRule `json:"rules"`
}
InboundPolicyConf defines model for InboundPolicyConf.
type InboundRule ¶ added in v2.10.9
type InboundRule struct {
// Conf The final computed configuration for the data plane proxy, derived by merging all policies whose 'targetRef' field matches the proxy. The merging process follows [RFC 7396 (JSON Merge Patch)](https://datatracker.ietf.org/doc/html/rfc7396), with the order of merging influenced by factors such as where the policy was applied (e.g., custom namespace, system, or global control plane), policy role, and targetRef specificity.
Conf []interface{} `json:"conf"`
// Origin The list of policies that contributed to the 'conf'. The order is important as it reflects in what order confs were merged to get the resulting 'conf'.
Origin []ResourceRuleOrigin `json:"origin"`
}
InboundRule defines model for InboundRule.
type InboundRulesEntry ¶ added in v2.10.9
type InboundRulesEntry struct {
Inbound Inbound `json:"inbound"`
// Rules The 'rules' field is an array to allow for future expansion when 'matches' conditions are added. Currently, it contains a single item.
Rules []InboundRule `json:"rules"`
}
InboundRulesEntry defines model for InboundRulesEntry.
type InspectRule ¶
type InspectRule struct {
// FromRules a set of rules for each inbound of this proxy
FromRules *[]FromRule `json:"fromRules,omitempty"`
// InboundRules a set of rules for each inbound port of the proxy. When the policy descriptor has 'isFromAsRules' set to true, this field supersedes 'fromRules' and should be used instead.
InboundRules *[]InboundRulesEntry `json:"inboundRules,omitempty"`
// ProxyRule a rule that affects the entire proxy
ProxyRule *ProxyRule `json:"proxyRule,omitempty"`
// ToResourceRules a set of rules for the outbounds produced by real resources (i.e MeshService, MeshExternalService, MeshMultiZoneService).
ToResourceRules *[]ResourceRule `json:"toResourceRules,omitempty"`
// ToRules a set of rules for the outbounds of this proxy. The field is not set when 'meshService.mode' on Mesh is set to 'Exclusive'.
ToRules *[]Rule `json:"toRules,omitempty"`
// Type the type of the policy
Type string `json:"type"`
// Warnings a set of warnings to show in policy matching
Warnings *[]string `json:"warnings,omitempty"`
}
InspectRule defines model for InspectRule.
type Internal ¶ added in v2.11.8
type Internal = Error
Internal Standard error. Follows the [AIP #193 - Errors](https://kong-aip.netlify.app/aip/193/) specification.
type InvalidParameters ¶
type InvalidParameters struct {
// Choices Optional field to provide a list of valid choices for the field that caused the error.
Choices *[]string `json:"choices,omitempty"`
// Field The name of the field that caused the error.
Field string `json:"field"`
// Reason A short, human-readable description of the problem.
// _Should_ be provided as "Sentence case" for direct use in a UI.
Reason string `json:"reason"`
// Rule May be provided as a hint to the user to help understand the type of failure.
// Additional guidance may be provided in additional fields, i.e. `choices`.
Rule *string `json:"rule,omitempty"`
// Source The location of the field that caused the error.
Source InvalidParametersSource `json:"source"`
}
InvalidParameters defines model for InvalidParameters.
type InvalidParametersSource ¶ added in v2.13.0
type InvalidParametersSource string
InvalidParametersSource The location of the field that caused the error.
const ( Body InvalidParametersSource = "body" Header InvalidParametersSource = "header" Path InvalidParametersSource = "path" Query InvalidParametersSource = "query" )
Defines values for InvalidParametersSource.
type JsonPatchItem ¶
type JsonPatchItem struct {
// Op Operation to be performed.
Op JsonPatchItemOp `json:"op"`
// Path A JSON Pointer path indicating the part of the document to operate on.
Path string `json:"path"`
// Value The value to be used within the operations.
Value interface{} `json:"value"`
}
JsonPatchItem defines model for JsonPatchItem.
type JsonPatchItemOp ¶
type JsonPatchItemOp string
JsonPatchItemOp Operation to be performed.
const ( Add JsonPatchItemOp = "add" Remove JsonPatchItemOp = "remove" Test JsonPatchItemOp = "test" )
Defines values for JsonPatchItemOp.
type Meta ¶
type Meta struct {
// KRI Kuma Resource Identifier (KRI) of the given resource
KRI *string `json:"kri,omitempty"`
// Labels Labels of the resource. Note: certain system labels are immutable after creation:
// - `kuma.io/origin`: Resource origin (zone/global). Immutable.
// - `kuma.io/zone`: Zone where resource originated. Immutable.
// - `kuma.io/display-name`: Display name for the resource. Immutable.
Labels map[string]string `json:"labels"`
// Mesh the mesh this resource is part of
Mesh string `json:"mesh"`
// Name the name of the resource
Name string `json:"name"`
// Type the type of this resource
Type string `json:"type"`
}
Meta defines model for Meta.
type NotFoundError ¶ added in v2.10.9
type NotFoundError struct {
Detail string `json:"detail"`
// Instance Used to return the correlation ID back to the user, in the format `<app>:trace:<correlation_id>`.
Instance string `json:"instance"`
// InvalidParameters All 400 errors **MUST** return an `invalid_parameters` key in the response.
// Used to indicate which fields have invalid values when validated.
InvalidParameters *[]InvalidParameters `json:"invalid_parameters,omitempty"`
// Status The HTTP status code for NotFoundError MUST be 404.
Status NotFoundErrorStatus `json:"status"`
Title string `json:"title"`
Type string `json:"type"`
}
NotFoundError defines model for NotFoundError.
type NotFoundErrorStatus ¶ added in v2.13.0
type NotFoundErrorStatus int
NotFoundErrorStatus The HTTP status code for NotFoundError MUST be 404.
const (
N404 NotFoundErrorStatus = 404
)
Defines values for NotFoundErrorStatus.
type PoliciesList ¶ added in v2.12.4
type PoliciesList struct {
// Policies The final computed configuration, derived by merging all policies whose 'targetRef' field matches the proxy. The merging process follows [RFC 7396 (JSON Merge Patch)](https://datatracker.ietf.org/doc/html/rfc7396), with the order of merging influenced by factors such as where the policy was applied (e.g., custom namespace, system, or global control plane), policy role, and targetRef specificity.
Policies []PolicyConf `json:"policies"`
}
PoliciesList defines model for PoliciesList.
type PolicyConf ¶ added in v2.12.4
type PolicyConf struct {
// Conf The final computed configuration for the data plane proxy, derived by merging all policies whose 'targetRef' field matches the proxy. The merging process follows [RFC 7396 (JSON Merge Patch)](https://datatracker.ietf.org/doc/html/rfc7396), with the order of merging influenced by factors such as where the policy was applied (e.g., custom namespace, system, or global control plane), policy role, and targetRef specificity.
Conf interface{} `json:"conf"`
Kind string `json:"kind"`
// Origins The list of policies KRI that contributed to the 'conf'. The order is important as it reflects in what order confs were merged to get the resulting 'conf'.
Origins []PolicyOrigin `json:"origins"`
}
PolicyConf defines model for PolicyConf.
type PolicyDescription ¶
type PolicyDescription struct {
// HasFromTargetRef indicates that this policy can be used as an inbound policy
HasFromTargetRef bool `json:"hasFromTargetRef"`
// HasToTargetRef indicates that this policy can be used as an outbound policy
HasToTargetRef bool `json:"hasToTargetRef"`
// IsFromAsRules If set to `true`, performs a backward compatibility conversion from the deprecated 'from' array to the new 'rules' array. This ensures older policies remain functional under the updated schema.
IsFromAsRules bool `json:"isFromAsRules"`
// IsTargetRef whether this policy uses targetRef matching
IsTargetRef bool `json:"isTargetRef"`
}
PolicyDescription information about a policy
type PolicyOrigin ¶ added in v2.12.4
type PolicyOrigin struct {
Kri string `json:"kri"`
}
PolicyOrigin The list of policies KRI that contributed to the 'conf'. The order is important as it reflects in what order confs were merged to get the resulting 'conf'.
type PolicyRule ¶ added in v2.12.4
type PolicyRule struct {
// Conf The final computed configuration for the data plane proxy, derived by merging all policies whose 'targetRef' field matches the proxy. The merging process follows [RFC 7396 (JSON Merge Patch)](https://datatracker.ietf.org/doc/html/rfc7396), with the order of merging influenced by factors such as where the policy was applied (e.g., custom namespace, system, or global control plane), policy role, and targetRef specificity.
Conf interface{} `json:"conf"`
Kri *string `json:"kri,omitempty"`
}
PolicyRule defines model for PolicyRule.
type ProxyRule ¶
type ProxyRule struct {
// Conf The actual conf generated
Conf interface{} `json:"conf"`
Origin []Meta `json:"origin"`
}
ProxyRule a rule that affects the entire proxy
type ResourceRule ¶ added in v2.10.9
type ResourceRule struct {
// Conf The actual conf generated
Conf []interface{} `json:"conf"`
// Origin The list of policies that contributed to the 'conf'. The order is important as it reflects in what order confs were merged to get the resulting 'conf'.
Origin []ResourceRuleOrigin `json:"origin"`
ResourceMeta Meta `json:"resourceMeta"`
ResourceSectionName *string `json:"resourceSectionName,omitempty"`
}
ResourceRule defines model for ResourceRule.
type ResourceRuleOrigin ¶ added in v2.10.9
type ResourceRuleOrigin struct {
ResourceMeta *Meta `json:"resourceMeta,omitempty"`
// RuleIndex index of the to-item in the policy
RuleIndex *int `json:"ruleIndex,omitempty"`
}
ResourceRuleOrigin defines model for ResourceRuleOrigin.
type ResourceTypeDescription ¶
type ResourceTypeDescription struct {
// IncludeInFederation description resources of this type should be included in federetion-with-policies export profile (especially useful for moving from non-federated to federated or migrating to a new global).
IncludeInFederation bool `json:"includeInFederation"`
// Name the name of the resource type
Name string `json:"name"`
// Path the path to use for accessing this resource. If scope is `Global` then it will be `/<path>` otherwise it will be `/meshes/<path>`
Path string `json:"path"`
PluralDisplayName string `json:"pluralDisplayName"`
// Policy information about a policy
Policy *PolicyDescription `json:"policy,omitempty"`
ReadOnly bool `json:"readOnly"`
Scope ResourceTypeDescriptionScope `json:"scope"`
// ShortName the short name of the resource type used in KRIs and kubectl
ShortName string `json:"shortName"`
SingularDisplayName string `json:"singularDisplayName"`
}
ResourceTypeDescription Description of a resource type, this is useful for dynamically generated clients and the gui
type ResourceTypeDescriptionScope ¶
type ResourceTypeDescriptionScope string
ResourceTypeDescriptionScope defines model for ResourceTypeDescription.Scope.
const ( Global ResourceTypeDescriptionScope = "Global" Mesh ResourceTypeDescriptionScope = "Mesh" )
Defines values for ResourceTypeDescriptionScope.
type RouteConf ¶ added in v2.12.4
type RouteConf struct {
Kind string `json:"kind"`
// Origins The list of policies KRI that contributed to the 'conf'. The order is important as it reflects in what order confs were merged to get the resulting 'conf'.
Origins []PolicyOrigin `json:"origins"`
// Rules Computed list of routing rules
Rules []RouteRules `json:"rules"`
}
RouteConf defines model for RouteConf.
type RouteRules ¶ added in v2.12.4
type RouteRules struct {
// Conf The final computed configuration for the data plane proxy, derived by merging all policies whose 'targetRef' field matches the proxy. The merging process follows [RFC 7396 (JSON Merge Patch)](https://datatracker.ietf.org/doc/html/rfc7396), with the order of merging influenced by factors such as where the policy was applied (e.g., custom namespace, system, or global control plane), policy role, and targetRef specificity.
Conf interface{} `json:"conf"`
Kri string `json:"kri"`
// Matches List of matches for which this rule will apply
Matches []interface{} `json:"matches"`
}
RouteRules defines model for RouteRules.
type RoutesList ¶ added in v2.12.4
type RoutesList struct {
// Routes Computed list of routes
Routes []RouteConf `json:"routes"`
}
RoutesList defines model for RoutesList.
type Rule ¶
type Rule struct {
// Conf The actual conf generated
Conf interface{} `json:"conf"`
Matchers []RuleMatcher `json:"matchers"`
Origin []Meta `json:"origin"`
}
Rule defines model for Rule.
type RuleMatcher ¶
type RuleMatcher struct {
// Key the key to match against
Key string `json:"key"`
// Not whether we check on the absence of this key:value pair
Not bool `json:"not"`
// Value the value for the key to match against
Value string `json:"value"`
}
RuleMatcher A matcher to select which traffic this conf applies to