resources

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxRefLength is the maximum allowed length for a ref
	MaxRefLength = 63
	// MinRefLength is the minimum allowed length for a ref
	MinRefLength = 1
)

Variables

This section is empty.

Functions

func GetNamespace added in v0.1.4

func GetNamespace(kongctl *KongctlMeta) string

GetNamespace safely extracts namespace from kongctl metadata

func ValidateRef

func ValidateRef(ref string) error

ValidateRef validates that a resource ref follows naming conventions

Types

type APIDocumentResource

type APIDocumentResource struct {
	kkComps.CreateAPIDocumentRequest `       yaml:",inline"                      json:",inline"`
	Ref                              string `yaml:"ref"                          json:"ref"`
	// Parent API reference (for root-level definitions)
	API              string `yaml:"api,omitempty"                json:"api,omitempty"`
	ParentDocumentID string `yaml:"parent_document_id,omitempty" json:"parent_document_id,omitempty"`
	// contains filtered or unexported fields
}

APIDocumentResource represents an API document in declarative configuration

func (APIDocumentResource) GetDependencies

func (d APIDocumentResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this API document depends on

func (APIDocumentResource) GetKonnectID

func (d APIDocumentResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (APIDocumentResource) GetKonnectMonikerFilter

func (d APIDocumentResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (APIDocumentResource) GetMoniker

func (d APIDocumentResource) GetMoniker() string

GetMoniker returns the resource moniker (for documents, this is the slug)

func (APIDocumentResource) GetParentRef

func (d APIDocumentResource) GetParentRef() *ResourceRef

GetParentRef returns the parent API reference for ResourceWithParent interface

func (APIDocumentResource) GetRef

func (d APIDocumentResource) GetRef() string

GetRef returns the reference identifier used for cross-resource references

func (APIDocumentResource) GetReferenceFieldMappings

func (d APIDocumentResource) GetReferenceFieldMappings() map[string]string

GetReferenceFieldMappings returns the field mappings for reference validation

func (APIDocumentResource) GetType added in v0.1.3

func (d APIDocumentResource) GetType() ResourceType

GetType returns the resource type

func (*APIDocumentResource) SetDefaults

func (d *APIDocumentResource) SetDefaults()

SetDefaults applies default values to API document resource

func (*APIDocumentResource) TryMatchKonnectResource

func (d *APIDocumentResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (*APIDocumentResource) UnmarshalJSON

func (d *APIDocumentResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshaling to handle SDK types

func (APIDocumentResource) Validate

func (d APIDocumentResource) Validate() error

Validate ensures the API document resource is valid

type APIImplementationResource

type APIImplementationResource struct {
	kkComps.APIImplementation `       yaml:",inline"       json:",inline"`
	Ref                       string `yaml:"ref"           json:"ref"`
	// Parent API reference (for root-level definitions)
	API string `yaml:"api,omitempty" json:"api,omitempty"`
	// contains filtered or unexported fields
}

APIImplementationResource represents an API implementation in declarative configuration

func (APIImplementationResource) GetDependencies

func (i APIImplementationResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this API implementation depends on

func (APIImplementationResource) GetKonnectID

func (i APIImplementationResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (APIImplementationResource) GetKonnectMonikerFilter

func (i APIImplementationResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (APIImplementationResource) GetMoniker

func (i APIImplementationResource) GetMoniker() string

GetMoniker returns the resource moniker (for implementations, this is empty)

func (APIImplementationResource) GetParentRef

func (i APIImplementationResource) GetParentRef() *ResourceRef

GetParentRef returns the parent API reference for ResourceWithParent interface

func (APIImplementationResource) GetRef

func (i APIImplementationResource) GetRef() string

GetRef returns the reference identifier used for cross-resource references

func (APIImplementationResource) GetReferenceFieldMappings

func (i APIImplementationResource) GetReferenceFieldMappings() map[string]string

GetReferenceFieldMappings returns the field mappings for reference validation

func (APIImplementationResource) GetType added in v0.1.3

GetType returns the resource type

func (*APIImplementationResource) SetDefaults

func (i *APIImplementationResource) SetDefaults()

SetDefaults applies default values to API implementation resource

func (*APIImplementationResource) TryMatchKonnectResource

func (i *APIImplementationResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (*APIImplementationResource) UnmarshalJSON

func (i *APIImplementationResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshaling to handle SDK types

func (APIImplementationResource) Validate

func (i APIImplementationResource) Validate() error

Validate ensures the API implementation resource is valid

type APIPublicationResource

type APIPublicationResource struct {
	kkComps.APIPublication `       yaml:",inline"       json:",inline"`
	Ref                    string `yaml:"ref"           json:"ref"`
	// Parent API reference (for root-level definitions)
	API      string `yaml:"api,omitempty" json:"api,omitempty"`
	PortalID string `yaml:"portal_id"     json:"portal_id"`
	// contains filtered or unexported fields
}

APIPublicationResource represents an API publication in declarative configuration

func (APIPublicationResource) GetDependencies

func (p APIPublicationResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this API publication depends on

func (APIPublicationResource) GetKonnectID

func (p APIPublicationResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (APIPublicationResource) GetKonnectMonikerFilter

func (p APIPublicationResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (APIPublicationResource) GetMoniker

func (p APIPublicationResource) GetMoniker() string

GetMoniker returns the resource moniker (for publications, this is the portal ID)

func (APIPublicationResource) GetParentRef

func (p APIPublicationResource) GetParentRef() *ResourceRef

GetParentRef returns the parent API reference for ResourceWithParent interface

func (APIPublicationResource) GetRef

func (p APIPublicationResource) GetRef() string

GetRef returns the reference identifier used for cross-resource references

func (APIPublicationResource) GetReferenceFieldMappings

func (p APIPublicationResource) GetReferenceFieldMappings() map[string]string

GetReferenceFieldMappings returns the field mappings for reference validation

func (APIPublicationResource) GetType added in v0.1.3

GetType returns the resource type

func (*APIPublicationResource) SetDefaults

func (p *APIPublicationResource) SetDefaults()

SetDefaults applies default values to API publication resource

func (*APIPublicationResource) TryMatchKonnectResource

func (p *APIPublicationResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (*APIPublicationResource) UnmarshalJSON

func (p *APIPublicationResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshaling to handle SDK types

func (APIPublicationResource) Validate

func (p APIPublicationResource) Validate() error

Validate ensures the API publication resource is valid

type APIResource

type APIResource struct {
	kkComps.CreateAPIRequest `             yaml:",inline"           json:",inline"`
	Ref                      string       `yaml:"ref"               json:"ref"`
	Kongctl                  *KongctlMeta `yaml:"kongctl,omitempty" json:"kongctl,omitempty"`

	// Nested child resources
	Versions        []APIVersionResource        `yaml:"versions,omitempty"        json:"versions,omitempty"`
	Publications    []APIPublicationResource    `yaml:"publications,omitempty"    json:"publications,omitempty"`
	Implementations []APIImplementationResource `yaml:"implementations,omitempty" json:"implementations,omitempty"`
	Documents       []APIDocumentResource       `yaml:"documents,omitempty"       json:"documents,omitempty"`
	// contains filtered or unexported fields
}

APIResource represents an API in declarative configuration

func (APIResource) GetDependencies

func (a APIResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this API depends on

func (APIResource) GetKonnectID

func (a APIResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (APIResource) GetKonnectMonikerFilter

func (a APIResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (APIResource) GetLabels

func (a APIResource) GetLabels() map[string]string

GetLabels returns the labels for this resource

func (APIResource) GetMoniker

func (a APIResource) GetMoniker() string

GetMoniker returns the resource moniker (for APIs, this is the name)

func (APIResource) GetRef

func (a APIResource) GetRef() string

GetRef returns the reference identifier used for cross-resource references

func (APIResource) GetReferenceFieldMappings

func (a APIResource) GetReferenceFieldMappings() map[string]string

GetReferenceFieldMappings returns the field mappings for reference validation

func (APIResource) GetType added in v0.1.3

func (a APIResource) GetType() ResourceType

GetType returns the resource type

func (*APIResource) SetDefaults

func (a *APIResource) SetDefaults()

SetDefaults applies default values to API resource

func (*APIResource) SetLabels

func (a *APIResource) SetLabels(labels map[string]string)

SetLabels sets the labels for this resource

func (*APIResource) TryMatchKonnectResource

func (a *APIResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (APIResource) Validate

func (a APIResource) Validate() error

Validate ensures the API resource is valid

type APIVersionResource

type APIVersionResource struct {
	kkComps.CreateAPIVersionRequest `       yaml:",inline"       json:",inline"`
	Ref                             string `yaml:"ref"           json:"ref"`
	// Parent API reference (for root-level definitions)
	API string `yaml:"api,omitempty" json:"api,omitempty"`
	// contains filtered or unexported fields
}

APIVersionResource represents an API version in declarative configuration

func (APIVersionResource) GetDependencies

func (v APIVersionResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this API version depends on

func (APIVersionResource) GetKonnectID

func (v APIVersionResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (APIVersionResource) GetKonnectMonikerFilter

func (v APIVersionResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (APIVersionResource) GetMoniker

func (v APIVersionResource) GetMoniker() string

GetMoniker returns the resource moniker (for versions, this is the version string)

func (APIVersionResource) GetParentRef

func (v APIVersionResource) GetParentRef() *ResourceRef

GetParentRef returns the parent API reference for ResourceWithParent interface

func (APIVersionResource) GetRef

func (v APIVersionResource) GetRef() string

GetRef returns the reference identifier used for cross-resource references

func (APIVersionResource) GetReferenceFieldMappings

func (v APIVersionResource) GetReferenceFieldMappings() map[string]string

GetReferenceFieldMappings returns the field mappings for reference validation

func (APIVersionResource) GetType added in v0.1.3

func (v APIVersionResource) GetType() ResourceType

GetType returns the resource type

func (*APIVersionResource) SetDefaults

func (v *APIVersionResource) SetDefaults()

SetDefaults applies default values to API version resource

func (*APIVersionResource) TryMatchKonnectResource

func (v *APIVersionResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (*APIVersionResource) UnmarshalJSON

func (v *APIVersionResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshaling to handle SDK types

func (APIVersionResource) Validate

func (v APIVersionResource) Validate() error

Validate ensures the API version resource is valid

type ApplicationAuthStrategyResource

type ApplicationAuthStrategyResource struct {
	kkComps.CreateAppAuthStrategyRequest `             yaml:",inline"           json:",inline"`
	Ref                                  string       `yaml:"ref"               json:"ref"`
	Kongctl                              *KongctlMeta `yaml:"kongctl,omitempty" json:"kongctl,omitempty"`
	// contains filtered or unexported fields
}

ApplicationAuthStrategyResource represents an application auth strategy in declarative configuration

func (ApplicationAuthStrategyResource) GetDependencies

func (a ApplicationAuthStrategyResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this auth strategy depends on

func (ApplicationAuthStrategyResource) GetKonnectID

func (a ApplicationAuthStrategyResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (ApplicationAuthStrategyResource) GetKonnectMonikerFilter

func (a ApplicationAuthStrategyResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (ApplicationAuthStrategyResource) GetLabels

func (a ApplicationAuthStrategyResource) GetLabels() map[string]string

GetLabels returns the labels for this resource

func (ApplicationAuthStrategyResource) GetMoniker

func (a ApplicationAuthStrategyResource) GetMoniker() string

GetMoniker returns the moniker (name) of the auth strategy from the union type

func (ApplicationAuthStrategyResource) GetRef

GetRef returns the reference identifier used for cross-resource references

func (ApplicationAuthStrategyResource) GetReferenceFieldMappings

func (a ApplicationAuthStrategyResource) GetReferenceFieldMappings() map[string]string

GetReferenceFieldMappings returns the field mappings for reference validation

func (ApplicationAuthStrategyResource) GetType added in v0.1.3

GetType returns the resource type

func (*ApplicationAuthStrategyResource) SetDefaults

func (a *ApplicationAuthStrategyResource) SetDefaults()

SetDefaults applies default values to application auth strategy resource

func (*ApplicationAuthStrategyResource) SetLabels

func (a *ApplicationAuthStrategyResource) SetLabels(labels map[string]string)

SetLabels sets the labels for this resource

func (*ApplicationAuthStrategyResource) TryMatchKonnectResource

func (a *ApplicationAuthStrategyResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (*ApplicationAuthStrategyResource) UnmarshalJSON

func (a *ApplicationAuthStrategyResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshaling to handle SDK union types (sigs.k8s.io/yaml uses JSON unmarshaling internally)

func (ApplicationAuthStrategyResource) Validate

Validate ensures the application auth strategy resource is valid

type ControlPlaneResource

type ControlPlaneResource struct {
	kkComps.CreateControlPlaneRequest `             yaml:",inline"           json:",inline"`
	Ref                               string       `yaml:"ref"               json:"ref"`
	Kongctl                           *KongctlMeta `yaml:"kongctl,omitempty" json:"kongctl,omitempty"`
	// contains filtered or unexported fields
}

ControlPlaneResource represents a control plane in declarative configuration

func (ControlPlaneResource) GetDependencies added in v0.1.3

func (c ControlPlaneResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this control plane depends on

func (ControlPlaneResource) GetKonnectID added in v0.1.3

func (c ControlPlaneResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (ControlPlaneResource) GetKonnectMonikerFilter added in v0.1.3

func (c ControlPlaneResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (ControlPlaneResource) GetMoniker added in v0.1.3

func (c ControlPlaneResource) GetMoniker() string

GetMoniker returns the resource moniker (for control planes, this is the name)

func (ControlPlaneResource) GetRef

func (c ControlPlaneResource) GetRef() string

GetRef returns the reference identifier used for cross-resource references

func (ControlPlaneResource) GetReferenceFieldMappings

func (c ControlPlaneResource) GetReferenceFieldMappings() map[string]string

GetReferenceFieldMappings returns the field mappings for reference validation

func (ControlPlaneResource) GetType added in v0.1.3

func (c ControlPlaneResource) GetType() ResourceType

GetType returns the resource type

func (*ControlPlaneResource) SetDefaults

func (c *ControlPlaneResource) SetDefaults()

SetDefaults applies default values to control plane resource

func (*ControlPlaneResource) TryMatchKonnectResource added in v0.1.3

func (c *ControlPlaneResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (ControlPlaneResource) Validate

func (c ControlPlaneResource) Validate() error

Validate ensures the control plane resource is valid

type ExternalBlock added in v0.1.5

type ExternalBlock struct {
	// Direct ID reference (use when you know the exact Konnect ID)
	ID string `yaml:"id,omitempty" json:"id,omitempty"`

	// Selector for querying by fields (use to find by name)
	Selector *ExternalSelector `yaml:"selector,omitempty" json:"selector,omitempty"`
}

ExternalBlock marks a resource as externally managed

func (*ExternalBlock) IsExternal added in v0.1.5

func (e *ExternalBlock) IsExternal() bool

IsExternal returns true if this resource is externally managed

func (*ExternalBlock) Validate added in v0.1.5

func (e *ExternalBlock) Validate() error

Validate ensures the external block is properly configured

type ExternalSelector added in v0.1.5

type ExternalSelector struct {
	// Field equality matches (initially just support name)
	MatchFields map[string]string `yaml:"matchFields" json:"matchFields"`
}

ExternalSelector defines field matching criteria

func (*ExternalSelector) Match added in v0.1.5

func (s *ExternalSelector) Match(konnectResource any) bool

Match checks if the given Konnect resource matches this selector

type FileDefaults

type FileDefaults struct {
	Kongctl *KongctlMetaDefaults `yaml:"kongctl,omitempty" json:"kongctl,omitempty"`
}

FileDefaults holds file-level defaults that apply to all resources in the file

type KongctlMeta

type KongctlMeta struct {
	// Protected prevents accidental deletion of critical resources
	Protected *bool `yaml:"protected,omitempty" json:"protected,omitempty"`
	// Namespace for resource isolation and multi-team management
	Namespace *string `yaml:"namespace,omitempty" json:"namespace,omitempty"`
}

KongctlMeta contains tool-specific metadata for resources

type KongctlMetaDefaults

type KongctlMetaDefaults struct {
	Namespace *string `yaml:"namespace,omitempty" json:"namespace,omitempty"`
	Protected *bool   `yaml:"protected,omitempty" json:"protected,omitempty"`
}

KongctlMetaDefaults holds default values for kongctl metadata fields

type PortalCustomDomainResource

type PortalCustomDomainResource struct {
	// Use CreatePortalCustomDomainRequest which contains only user-configurable fields
	// This aligns with the pattern used by other resources (API, APIVersion, etc.)
	kkComps.CreatePortalCustomDomainRequest `       yaml:",inline"          json:",inline"`
	Ref                                     string `yaml:"ref,omitempty"    json:"ref,omitempty"`
	// Parent portal reference
	Portal string `yaml:"portal,omitempty" json:"portal,omitempty"`
	// contains filtered or unexported fields
}

PortalCustomDomainResource represents a portal custom domain configuration

func (PortalCustomDomainResource) GetDependencies added in v0.1.3

func (d PortalCustomDomainResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this custom domain depends on

func (PortalCustomDomainResource) GetKonnectID added in v0.1.3

func (d PortalCustomDomainResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (PortalCustomDomainResource) GetKonnectMonikerFilter added in v0.1.3

func (d PortalCustomDomainResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (PortalCustomDomainResource) GetMoniker added in v0.1.3

func (d PortalCustomDomainResource) GetMoniker() string

GetMoniker returns the resource moniker (for custom domains, this is the hostname)

func (PortalCustomDomainResource) GetRef

GetRef returns the reference identifier

func (PortalCustomDomainResource) GetType added in v0.1.3

GetType returns the resource type

func (*PortalCustomDomainResource) SetDefaults

func (d *PortalCustomDomainResource) SetDefaults()

SetDefaults applies default values

func (*PortalCustomDomainResource) TryMatchKonnectResource added in v0.1.3

func (d *PortalCustomDomainResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (PortalCustomDomainResource) Validate

func (d PortalCustomDomainResource) Validate() error

Validate ensures the portal custom domain resource is valid

type PortalCustomizationResource

type PortalCustomizationResource struct {
	kkComps.PortalCustomization `       yaml:",inline"          json:",inline"`
	Ref                         string `yaml:"ref,omitempty"    json:"ref,omitempty"`
	Portal                      string `yaml:"portal,omitempty" json:"portal,omitempty"` // Parent portal reference
	// contains filtered or unexported fields
}

PortalCustomizationResource represents portal customization settings

func (PortalCustomizationResource) GetDependencies added in v0.1.3

func (c PortalCustomizationResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this customization depends on

func (PortalCustomizationResource) GetKonnectID added in v0.1.3

func (c PortalCustomizationResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (PortalCustomizationResource) GetKonnectMonikerFilter added in v0.1.3

func (c PortalCustomizationResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (PortalCustomizationResource) GetMoniker added in v0.1.3

func (c PortalCustomizationResource) GetMoniker() string

GetMoniker returns the resource moniker (for customizations, this is the ref)

func (PortalCustomizationResource) GetRef

GetRef returns the reference identifier

func (PortalCustomizationResource) GetType added in v0.1.3

GetType returns the resource type

func (*PortalCustomizationResource) SetDefaults

func (c *PortalCustomizationResource) SetDefaults()

SetDefaults applies default values

func (*PortalCustomizationResource) TryMatchKonnectResource added in v0.1.3

func (c *PortalCustomizationResource) TryMatchKonnectResource(_ any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (PortalCustomizationResource) Validate

func (c PortalCustomizationResource) Validate() error

Validate ensures the portal customization resource is valid

type PortalPageResource

type PortalPageResource struct {
	kkComps.CreatePortalPageRequest `                     yaml:",inline"                   json:",inline"`
	Ref                             string `yaml:"ref"                       json:"ref"`
	// Parent portal reference
	Portal string `yaml:"portal,omitempty"          json:"portal,omitempty"`
	// Reference to parent page
	ParentPageRef string `yaml:"parent_page_ref,omitempty" json:"parent_page_ref,omitempty"`
	// Nested child pages
	Children []PortalPageResource `yaml:"children,omitempty"        json:"children,omitempty"`
	// contains filtered or unexported fields
}

PortalPageResource represents a portal page

func (PortalPageResource) GetDependencies added in v0.1.3

func (p PortalPageResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this page depends on

func (PortalPageResource) GetKonnectID added in v0.1.3

func (p PortalPageResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (PortalPageResource) GetKonnectMonikerFilter added in v0.1.3

func (p PortalPageResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (PortalPageResource) GetMoniker added in v0.1.3

func (p PortalPageResource) GetMoniker() string

GetMoniker returns the resource moniker (for pages, this is the slug)

func (PortalPageResource) GetRef

func (p PortalPageResource) GetRef() string

GetRef returns the reference identifier

func (PortalPageResource) GetType added in v0.1.3

func (p PortalPageResource) GetType() ResourceType

GetType returns the resource type

func (*PortalPageResource) SetDefaults

func (p *PortalPageResource) SetDefaults()

SetDefaults applies default values

func (*PortalPageResource) TryMatchKonnectResource added in v0.1.3

func (p *PortalPageResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (PortalPageResource) Validate

func (p PortalPageResource) Validate() error

Validate ensures the portal page resource is valid

type PortalResource

type PortalResource struct {
	kkComps.CreatePortal `             yaml:",inline"           json:",inline"`
	Ref                  string       `yaml:"ref"               json:"ref"`
	Kongctl              *KongctlMeta `yaml:"kongctl,omitempty" json:"kongctl,omitempty"`

	// Child resources that match API endpoints
	Customization *PortalCustomizationResource `yaml:"customization,omitempty" json:"customization,omitempty"`
	CustomDomain  *PortalCustomDomainResource  `yaml:"custom_domain,omitempty" json:"custom_domain,omitempty"`
	Pages         []PortalPageResource         `yaml:"pages,omitempty"         json:"pages,omitempty"`
	Snippets      []PortalSnippetResource      `yaml:"snippets,omitempty"      json:"snippets,omitempty"`

	// External resource marker
	External *ExternalBlock `yaml:"_external,omitempty" json:"_external,omitempty"`
	// contains filtered or unexported fields
}

PortalResource represents a portal in declarative configuration

func (PortalResource) GetDependencies

func (p PortalResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this portal depends on

func (PortalResource) GetKonnectID

func (p PortalResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (PortalResource) GetKonnectMonikerFilter

func (p PortalResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (PortalResource) GetLabels

func (p PortalResource) GetLabels() map[string]string

GetLabels returns the labels for this resource

func (PortalResource) GetMoniker

func (p PortalResource) GetMoniker() string

GetMoniker returns the resource moniker (for portals, this is the name)

func (PortalResource) GetRef

func (p PortalResource) GetRef() string

GetRef returns the reference identifier used for cross-resource references

func (PortalResource) GetReferenceFieldMappings

func (p PortalResource) GetReferenceFieldMappings() map[string]string

GetReferenceFieldMappings returns the field mappings for reference validation

func (PortalResource) GetType added in v0.1.3

func (p PortalResource) GetType() ResourceType

GetType returns the resource type

func (*PortalResource) IsExternal added in v0.1.5

func (p *PortalResource) IsExternal() bool

IsExternal returns true if this portal is externally managed

func (*PortalResource) SetDefaults

func (p *PortalResource) SetDefaults()

SetDefaults applies default values to portal resource

func (*PortalResource) SetLabels

func (p *PortalResource) SetLabels(labels map[string]string)

SetLabels sets the labels for this resource

func (*PortalResource) TryMatchKonnectResource

func (p *PortalResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (PortalResource) Validate

func (p PortalResource) Validate() error

Validate ensures the portal resource is valid

type PortalSnippetResource

type PortalSnippetResource struct {
	Ref string `yaml:"ref"                   json:"ref"`
	// Parent portal reference
	Portal      string                           `yaml:"portal,omitempty"      json:"portal,omitempty"`
	Name        string                           `yaml:"name"                  json:"name"`
	Content     string                           `yaml:"content"               json:"content"`
	Title       *string                          `yaml:"title,omitempty"       json:"title,omitempty"`
	Visibility  *kkComps.SnippetVisibilityStatus `yaml:"visibility,omitempty"  json:"visibility,omitempty"`
	Status      *kkComps.PublishedStatus         `yaml:"status,omitempty"      json:"status,omitempty"`
	Description *string                          `yaml:"description,omitempty" json:"description,omitempty"`
	// contains filtered or unexported fields
}

PortalSnippetResource represents a portal snippet

func (PortalSnippetResource) GetDependencies added in v0.1.3

func (s PortalSnippetResource) GetDependencies() []ResourceRef

GetDependencies returns references to other resources this snippet depends on

func (PortalSnippetResource) GetKonnectID added in v0.1.3

func (s PortalSnippetResource) GetKonnectID() string

GetKonnectID returns the resolved Konnect ID if available

func (PortalSnippetResource) GetKonnectMonikerFilter added in v0.1.3

func (s PortalSnippetResource) GetKonnectMonikerFilter() string

GetKonnectMonikerFilter returns the filter string for Konnect API lookup

func (PortalSnippetResource) GetMoniker added in v0.1.3

func (s PortalSnippetResource) GetMoniker() string

GetMoniker returns the resource moniker (for snippets, this is the name)

func (PortalSnippetResource) GetRef

func (s PortalSnippetResource) GetRef() string

GetRef returns the reference identifier

func (PortalSnippetResource) GetType added in v0.1.3

func (s PortalSnippetResource) GetType() ResourceType

GetType returns the resource type

func (*PortalSnippetResource) SetDefaults

func (s *PortalSnippetResource) SetDefaults()

SetDefaults applies default values

func (*PortalSnippetResource) TryMatchKonnectResource added in v0.1.3

func (s *PortalSnippetResource) TryMatchKonnectResource(konnectResource any) bool

TryMatchKonnectResource attempts to match this resource with a Konnect resource

func (PortalSnippetResource) Validate

func (s PortalSnippetResource) Validate() error

Validate ensures the portal snippet resource is valid

type RefReader added in v0.1.3

type RefReader interface {
	// HasRef checks if a ref exists globally across all resource types
	HasRef(ref string) bool

	// GetResourceByRef returns the resource for a given ref
	// Returns nil and false if not found
	GetResourceByRef(ref string) (Resource, bool)

	// GetResourceTypeByRef returns the resource type for a given ref
	// This is a convenience method that uses GetResourceByRef
	GetResourceTypeByRef(ref string) (ResourceType, bool)
}

RefReader provides read-only access to resources by ref

type ReferenceMapping

type ReferenceMapping interface {
	GetReferenceFieldMappings() map[string]string
}

ReferenceMapping interface for resources that have reference fields

type ReferencedResource

type ReferencedResource interface {
	GetRef() string
}

ReferencedResource interface for resources that can be referenced

type Resource

type Resource interface {
	GetType() ResourceType
	GetRef() string
	GetMoniker() string // Generic identifier (name, username, version, etc.)
	GetDependencies() []ResourceRef
	Validate() error
	SetDefaults()

	// Identity resolution methods
	GetKonnectID() string                             // Returns the Konnect ID if resolved, empty otherwise
	GetKonnectMonikerFilter() string                  // Returns filter string for Konnect API lookup
	TryMatchKonnectResource(konnectResource any) bool // Matches against Konnect resource
}

Resource is the common interface for all declarative resources

type ResourceRef

type ResourceRef struct {
	Kind string `json:"kind" yaml:"kind"`
	Ref  string `json:"ref"  yaml:"ref"`
}

ResourceRef represents a reference to another resource

type ResourceSet

type ResourceSet struct {
	Portals []PortalResource `yaml:"portals,omitempty"                     json:"portals,omitempty"`
	// ApplicationAuthStrategies contains auth strategy configurations
	ApplicationAuthStrategies []ApplicationAuthStrategyResource `yaml:"application_auth_strategies,omitempty" json:"application_auth_strategies,omitempty"` //nolint:lll
	// ControlPlanes contains control plane configurations
	ControlPlanes []ControlPlaneResource `yaml:"control_planes,omitempty"              json:"control_planes,omitempty"`
	APIs          []APIResource          `yaml:"apis,omitempty"                        json:"apis,omitempty"`
	// API child resources can be defined at root level (with parent reference) or nested under APIs
	APIVersions        []APIVersionResource        `yaml:"api_versions,omitempty"                json:"api_versions,omitempty"`        //nolint:lll
	APIPublications    []APIPublicationResource    `yaml:"api_publications,omitempty"            json:"api_publications,omitempty"`    //nolint:lll
	APIImplementations []APIImplementationResource `yaml:"api_implementations,omitempty"         json:"api_implementations,omitempty"` //nolint:lll
	APIDocuments       []APIDocumentResource       `yaml:"api_documents,omitempty"               json:"api_documents,omitempty"`       //nolint:lll
	// Portal child resources can be defined at root level (with parent reference) or nested under Portals
	PortalCustomizations []PortalCustomizationResource `yaml:"portal_customizations,omitempty"       json:"portal_customizations,omitempty"` //nolint:lll
	PortalCustomDomains  []PortalCustomDomainResource  `yaml:"portal_custom_domains,omitempty"       json:"portal_custom_domains,omitempty"` //nolint:lll
	PortalPages          []PortalPageResource          `yaml:"portal_pages,omitempty"                json:"portal_pages,omitempty"`          //nolint:lll
	PortalSnippets       []PortalSnippetResource       `yaml:"portal_snippets,omitempty"             json:"portal_snippets,omitempty"`       //nolint:lll

	// DefaultNamespace tracks namespace from _defaults when no resources are present
	// This is used by the planner to determine which namespace to check for deletions
	DefaultNamespace string `yaml:"-" json:"-"`
}

ResourceSet contains all declarative resources from configuration files

func (*ResourceSet) GetAPIByRef added in v0.1.4

func (rs *ResourceSet) GetAPIByRef(ref string) *APIResource

GetAPIByRef returns an API resource by its ref from any namespace

func (*ResourceSet) GetAPIDocumentsByNamespace added in v0.1.4

func (rs *ResourceSet) GetAPIDocumentsByNamespace(namespace string) []APIDocumentResource

GetAPIDocumentsByNamespace returns all API document resources from the specified namespace

func (*ResourceSet) GetAPIImplementationsByNamespace added in v0.1.4

func (rs *ResourceSet) GetAPIImplementationsByNamespace(namespace string) []APIImplementationResource

GetAPIImplementationsByNamespace returns all API implementation resources from the specified namespace

func (*ResourceSet) GetAPIPublicationsByNamespace added in v0.1.4

func (rs *ResourceSet) GetAPIPublicationsByNamespace(namespace string) []APIPublicationResource

GetAPIPublicationsByNamespace returns all API publication resources from the specified namespace

func (*ResourceSet) GetAPIVersionsByNamespace added in v0.1.4

func (rs *ResourceSet) GetAPIVersionsByNamespace(namespace string) []APIVersionResource

GetAPIVersionsByNamespace returns all API version resources from the specified namespace

func (*ResourceSet) GetAPIsByNamespace added in v0.1.4

func (rs *ResourceSet) GetAPIsByNamespace(namespace string) []APIResource

GetAPIsByNamespace returns all API resources from the specified namespace

func (*ResourceSet) GetAuthStrategiesByNamespace added in v0.1.4

func (rs *ResourceSet) GetAuthStrategiesByNamespace(namespace string) []ApplicationAuthStrategyResource

GetAuthStrategiesByNamespace returns all auth strategy resources from the specified namespace

func (*ResourceSet) GetAuthStrategyByRef added in v0.1.4

func (rs *ResourceSet) GetAuthStrategyByRef(ref string) *ApplicationAuthStrategyResource

GetAuthStrategyByRef returns an auth strategy resource by its ref from any namespace

func (*ResourceSet) GetPortalByRef added in v0.1.4

func (rs *ResourceSet) GetPortalByRef(ref string) *PortalResource

GetPortalByRef returns a portal resource by its ref from any namespace

func (*ResourceSet) GetPortalCustomDomainsByNamespace added in v0.1.4

func (rs *ResourceSet) GetPortalCustomDomainsByNamespace(namespace string) []PortalCustomDomainResource

GetPortalCustomDomainsByNamespace returns all portal custom domain resources from the specified namespace

func (*ResourceSet) GetPortalCustomizationsByNamespace added in v0.1.4

func (rs *ResourceSet) GetPortalCustomizationsByNamespace(namespace string) []PortalCustomizationResource

GetPortalCustomizationsByNamespace returns all portal customization resources from the specified namespace

func (*ResourceSet) GetPortalPagesByNamespace added in v0.1.4

func (rs *ResourceSet) GetPortalPagesByNamespace(namespace string) []PortalPageResource

GetPortalPagesByNamespace returns all portal page resources from the specified namespace

func (*ResourceSet) GetPortalSnippetsByNamespace added in v0.1.4

func (rs *ResourceSet) GetPortalSnippetsByNamespace(namespace string) []PortalSnippetResource

GetPortalSnippetsByNamespace returns all portal snippet resources from the specified namespace

func (*ResourceSet) GetPortalsByNamespace added in v0.1.4

func (rs *ResourceSet) GetPortalsByNamespace(namespace string) []PortalResource

GetPortalsByNamespace returns all portal resources from the specified namespace

func (*ResourceSet) GetResourceByRef added in v0.1.3

func (rs *ResourceSet) GetResourceByRef(ref string) (Resource, bool)

GetResourceByRef returns the resource for a given ref

func (*ResourceSet) GetResourceTypeByRef added in v0.1.3

func (rs *ResourceSet) GetResourceTypeByRef(ref string) (ResourceType, bool)

GetResourceTypeByRef returns the resource type for a given ref

func (*ResourceSet) HasRef added in v0.1.3

func (rs *ResourceSet) HasRef(ref string) bool

HasRef checks if a ref exists globally across all resource types

type ResourceType added in v0.1.3

type ResourceType string

ResourceType represents the type of a declarative resource

const (
	ResourceTypePortal                  ResourceType = "portal"
	ResourceTypeApplicationAuthStrategy ResourceType = "application_auth_strategy"
	ResourceTypeControlPlane            ResourceType = "control_plane"
	ResourceTypeAPI                     ResourceType = "api"
	ResourceTypeAPIVersion              ResourceType = "api_version"
	ResourceTypeAPIPublication          ResourceType = "api_publication"
	ResourceTypeAPIImplementation       ResourceType = "api_implementation"
	ResourceTypeAPIDocument             ResourceType = "api_document"
	ResourceTypePortalCustomization     ResourceType = "portal_customization"
	ResourceTypePortalCustomDomain      ResourceType = "portal_custom_domain"
	ResourceTypePortalPage              ResourceType = "portal_page"
	ResourceTypePortalSnippet           ResourceType = "portal_snippet"
)

Resource type constants

type ResourceValidator

type ResourceValidator interface {
	Validate() error
}

ResourceValidator interface for common validation behavior

type ResourceWithLabels

type ResourceWithLabels interface {
	Resource
	GetLabels() map[string]string
	SetLabels(map[string]string)
}

ResourceWithLabels represents resources that support labels

type ResourceWithParent

type ResourceWithParent interface {
	Resource
	GetParentRef() *ResourceRef
}

ResourceWithParent represents resources that have a parent

Jump to

Keyboard shortcuts

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