Documentation
¶
Index ¶
- type APIAdapter
- func (p *APIAdapter) Create(ctx context.Context, req kkComps.CreateAPIRequest, namespace string) (string, error)
- func (p *APIAdapter) Delete(ctx context.Context, id string) error
- func (p *APIAdapter) GetByID(ctx context.Context, id string) (ResourceInfo, error)
- func (p *APIAdapter) GetByName(ctx context.Context, name string) (ResourceInfo, error)
- func (p *APIAdapter) MapCreateFields(ctx context.Context, fields map[string]interface{}, ...) error
- func (p *APIAdapter) MapUpdateFields(ctx context.Context, fields map[string]interface{}, ...) error
- func (p *APIAdapter) RequiredFields() []string
- func (p *APIAdapter) ResourceType() string
- func (p *APIAdapter) SupportsUpdate() bool
- func (p *APIAdapter) Update(ctx context.Context, id string, req kkComps.UpdateAPIRequest, namespace string) (string, error)
- type APIDocumentAdapter
- func (a *APIDocumentAdapter) Create(ctx context.Context, req kkComps.CreateAPIDocumentRequest, _ string) (string, error)
- func (a *APIDocumentAdapter) Delete(ctx context.Context, id string) error
- func (a *APIDocumentAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
- func (a *APIDocumentAdapter) MapCreateFields(_ context.Context, fields map[string]interface{}, ...) error
- func (a *APIDocumentAdapter) MapUpdateFields(_ context.Context, fields map[string]interface{}, update *kkComps.APIDocument, ...) error
- func (a *APIDocumentAdapter) RequiredFields() []string
- func (a *APIDocumentAdapter) ResourceType() string
- func (a *APIDocumentAdapter) SupportsUpdate() bool
- func (a *APIDocumentAdapter) Update(ctx context.Context, id string, req kkComps.APIDocument, _ string) (string, error)
- type APIDocumentResourceInfo
- type APIImplementationAdapter
- func (a *APIImplementationAdapter) Create(_ context.Context, _ kkComps.CreateAPIVersionRequest, _ string) (string, error)
- func (a *APIImplementationAdapter) Delete(_ context.Context, _ string) error
- func (a *APIImplementationAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
- func (a *APIImplementationAdapter) MapCreateFields(_ context.Context, _ map[string]interface{}, ...) error
- func (a *APIImplementationAdapter) MapUpdateFields(_ context.Context, _ map[string]interface{}, _ *kkComps.APIVersion, ...) error
- func (a *APIImplementationAdapter) RequiredFields() []string
- func (a *APIImplementationAdapter) ResourceType() string
- func (a *APIImplementationAdapter) SupportsUpdate() bool
- func (a *APIImplementationAdapter) Update(_ context.Context, _ string, _ kkComps.APIVersion, _ string) (string, error)
- type APIImplementationResourceInfo
- type APIPublicationAdapter
- func (a *APIPublicationAdapter) Create(ctx context.Context, req kkComps.APIPublication, _ string) (string, error)
- func (a *APIPublicationAdapter) Delete(ctx context.Context, id string) error
- func (a *APIPublicationAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
- func (a *APIPublicationAdapter) MapCreateFields(ctx context.Context, fields map[string]interface{}, ...) error
- func (a *APIPublicationAdapter) RequiredFields() []string
- func (a *APIPublicationAdapter) ResourceType() string
- type APIPublicationResourceInfo
- type APIResourceInfo
- type APIVersionAdapter
- func (a *APIVersionAdapter) Create(ctx context.Context, req kkComps.CreateAPIVersionRequest, _ string) (string, error)
- func (a *APIVersionAdapter) Delete(ctx context.Context, id string) error
- func (a *APIVersionAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
- func (a *APIVersionAdapter) MapCreateFields(_ context.Context, fields map[string]interface{}, ...) error
- func (a *APIVersionAdapter) RequiredFields() []string
- func (a *APIVersionAdapter) ResourceType() string
- type APIVersionResourceInfo
- type AppliedChange
- type AuthStrategyAdapter
- func (a *AuthStrategyAdapter) Create(ctx context.Context, req kkComps.CreateAppAuthStrategyRequest, ...) (string, error)
- func (a *AuthStrategyAdapter) Delete(ctx context.Context, id string) error
- func (a *AuthStrategyAdapter) GetByName(ctx context.Context, name string) (ResourceInfo, error)
- func (a *AuthStrategyAdapter) MapCreateFields(ctx context.Context, fields map[string]interface{}, ...) error
- func (a *AuthStrategyAdapter) MapUpdateFields(ctx context.Context, fields map[string]interface{}, ...) error
- func (a *AuthStrategyAdapter) RequiredFields() []string
- func (a *AuthStrategyAdapter) ResourceType() string
- func (a *AuthStrategyAdapter) SupportsUpdate() bool
- func (a *AuthStrategyAdapter) Update(ctx context.Context, id string, req kkComps.UpdateAppAuthStrategyRequest, ...) (string, error)
- type AuthStrategyResourceInfo
- type BaseCreateDeleteExecutor
- type BaseExecutor
- func (b *BaseExecutor[TCreate, TUpdate]) Create(ctx context.Context, change planner.PlannedChange) (string, error)
- func (b *BaseExecutor[TCreate, TUpdate]) Delete(ctx context.Context, change planner.PlannedChange) error
- func (b *BaseExecutor[TCreate, TUpdate]) Update(ctx context.Context, change planner.PlannedChange) (string, error)
- type BaseSingletonExecutor
- type ConsoleReporter
- func (r *ConsoleReporter) CompleteChange(change planner.PlannedChange, err error)
- func (r *ConsoleReporter) FinishExecution(result *ExecutionResult)
- func (r *ConsoleReporter) SkipChange(change planner.PlannedChange, reason string)
- func (r *ConsoleReporter) StartChange(change planner.PlannedChange)
- func (r *ConsoleReporter) StartExecution(plan *planner.Plan)
- type CreateDeleteOperations
- type ExecutionError
- type ExecutionResult
- type Executor
- type ParentAwareOperations
- type PortalAdapter
- func (p *PortalAdapter) Create(ctx context.Context, req kkComps.CreatePortal, namespace string) (string, error)
- func (p *PortalAdapter) Delete(ctx context.Context, id string) error
- func (p *PortalAdapter) GetByName(ctx context.Context, name string) (ResourceInfo, error)
- func (p *PortalAdapter) MapCreateFields(ctx context.Context, fields map[string]interface{}, ...) error
- func (p *PortalAdapter) MapUpdateFields(ctx context.Context, fields map[string]interface{}, ...) error
- func (p *PortalAdapter) RequiredFields() []string
- func (p *PortalAdapter) ResourceType() string
- func (p *PortalAdapter) SupportsUpdate() bool
- func (p *PortalAdapter) Update(ctx context.Context, id string, req kkComps.UpdatePortal, namespace string) (string, error)
- type PortalCustomizationAdapter
- type PortalDomainAdapter
- func (p *PortalDomainAdapter) Create(ctx context.Context, req kkComps.CreatePortalCustomDomainRequest, _ string) (string, error)
- func (p *PortalDomainAdapter) Delete(ctx context.Context, id string) error
- func (p *PortalDomainAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
- func (p *PortalDomainAdapter) MapCreateFields(_ context.Context, fields map[string]interface{}, ...) error
- func (p *PortalDomainAdapter) MapUpdateFields(_ context.Context, fields map[string]interface{}, ...) error
- func (p *PortalDomainAdapter) RequiredFields() []string
- func (p *PortalDomainAdapter) ResourceType() string
- func (p *PortalDomainAdapter) SupportsUpdate() bool
- func (p *PortalDomainAdapter) Update(ctx context.Context, id string, req kkComps.UpdatePortalCustomDomainRequest, ...) (string, error)
- type PortalDomainResourceInfo
- type PortalPageAdapter
- func (p *PortalPageAdapter) Create(ctx context.Context, req kkComps.CreatePortalPageRequest, _ string) (string, error)
- func (p *PortalPageAdapter) Delete(ctx context.Context, id string) error
- func (p *PortalPageAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
- func (p *PortalPageAdapter) MapCreateFields(ctx context.Context, fields map[string]interface{}, ...) error
- func (p *PortalPageAdapter) MapUpdateFields(ctx context.Context, fields map[string]interface{}, ...) error
- func (p *PortalPageAdapter) RequiredFields() []string
- func (p *PortalPageAdapter) ResourceType() string
- func (p *PortalPageAdapter) SupportsUpdate() bool
- func (p *PortalPageAdapter) Update(ctx context.Context, id string, req kkComps.UpdatePortalPageRequest, _ string) (string, error)
- type PortalPageResourceInfo
- type PortalResourceInfo
- type PortalSnippetAdapter
- func (p *PortalSnippetAdapter) Create(ctx context.Context, req kkComps.CreatePortalSnippetRequest, _ string) (string, error)
- func (p *PortalSnippetAdapter) Delete(ctx context.Context, id string) error
- func (p *PortalSnippetAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
- func (p *PortalSnippetAdapter) MapCreateFields(_ context.Context, fields map[string]interface{}, ...) error
- func (p *PortalSnippetAdapter) MapUpdateFields(_ context.Context, fields map[string]interface{}, ...) error
- func (p *PortalSnippetAdapter) RequiredFields() []string
- func (p *PortalSnippetAdapter) ResourceType() string
- func (p *PortalSnippetAdapter) SupportsUpdate() bool
- func (p *PortalSnippetAdapter) Update(ctx context.Context, id string, req kkComps.UpdatePortalSnippetRequest, ...) (string, error)
- type PortalSnippetResourceInfo
- type ProgressReporter
- type ResourceInfo
- type ResourceOperations
- type SingletonOperations
- type ValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIAdapter ¶
type APIAdapter struct {
// contains filtered or unexported fields
}
APIAdapter implements ResourceOperations for APIs
func NewAPIAdapter ¶
func NewAPIAdapter(client *state.Client) *APIAdapter
NewAPIAdapter creates a new API adapter
func (*APIAdapter) Create ¶
func (p *APIAdapter) Create(ctx context.Context, req kkComps.CreateAPIRequest, namespace string) (string, error)
Create creates a new API
func (*APIAdapter) Delete ¶
func (p *APIAdapter) Delete(ctx context.Context, id string) error
Delete deletes an API
func (*APIAdapter) GetByID ¶
func (p *APIAdapter) GetByID(ctx context.Context, id string) (ResourceInfo, error)
GetByID gets an API by ID
func (*APIAdapter) GetByName ¶
func (p *APIAdapter) GetByName(ctx context.Context, name string) (ResourceInfo, error)
GetByName gets an API by name
func (*APIAdapter) MapCreateFields ¶
func (p *APIAdapter) MapCreateFields(ctx context.Context, fields map[string]interface{}, create *kkComps.CreateAPIRequest) error
MapCreateFields maps fields to CreateAPIRequest
func (*APIAdapter) MapUpdateFields ¶
func (p *APIAdapter) MapUpdateFields(ctx context.Context, fields map[string]interface{}, update *kkComps.UpdateAPIRequest, currentLabels map[string]string) error
MapUpdateFields maps fields to UpdateAPIRequest
func (*APIAdapter) RequiredFields ¶
func (p *APIAdapter) RequiredFields() []string
RequiredFields returns the required fields for creation
func (*APIAdapter) ResourceType ¶
func (p *APIAdapter) ResourceType() string
ResourceType returns the resource type name
func (*APIAdapter) SupportsUpdate ¶
func (p *APIAdapter) SupportsUpdate() bool
SupportsUpdate returns true as APIs support updates
type APIDocumentAdapter ¶
type APIDocumentAdapter struct {
// contains filtered or unexported fields
}
APIDocumentAdapter implements ResourceOperations for API documents
func NewAPIDocumentAdapter ¶
func NewAPIDocumentAdapter(client *state.Client) *APIDocumentAdapter
NewAPIDocumentAdapter creates a new API document adapter
func (*APIDocumentAdapter) Create ¶
func (a *APIDocumentAdapter) Create(ctx context.Context, req kkComps.CreateAPIDocumentRequest, _ string) (string, error)
Create creates a new API document
func (*APIDocumentAdapter) Delete ¶
func (a *APIDocumentAdapter) Delete(ctx context.Context, id string) error
Delete deletes an API document
func (*APIDocumentAdapter) GetByName ¶
func (a *APIDocumentAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
GetByName gets an API document by slug
func (*APIDocumentAdapter) MapCreateFields ¶
func (a *APIDocumentAdapter) MapCreateFields(_ context.Context, fields map[string]interface{}, create *kkComps.CreateAPIDocumentRequest) error
MapCreateFields maps fields to CreateAPIDocumentRequest
func (*APIDocumentAdapter) MapUpdateFields ¶
func (a *APIDocumentAdapter) MapUpdateFields(_ context.Context, fields map[string]interface{}, update *kkComps.APIDocument, _ map[string]string) error
MapUpdateFields maps fields to APIDocument
func (*APIDocumentAdapter) RequiredFields ¶
func (a *APIDocumentAdapter) RequiredFields() []string
RequiredFields returns the required fields for creation
func (*APIDocumentAdapter) ResourceType ¶
func (a *APIDocumentAdapter) ResourceType() string
ResourceType returns the resource type name
func (*APIDocumentAdapter) SupportsUpdate ¶
func (a *APIDocumentAdapter) SupportsUpdate() bool
SupportsUpdate returns true as documents support updates
type APIDocumentResourceInfo ¶
type APIDocumentResourceInfo struct {
// contains filtered or unexported fields
}
APIDocumentResourceInfo implements ResourceInfo for API documents
func (*APIDocumentResourceInfo) GetID ¶
func (a *APIDocumentResourceInfo) GetID() string
func (*APIDocumentResourceInfo) GetLabels ¶
func (a *APIDocumentResourceInfo) GetLabels() map[string]string
func (*APIDocumentResourceInfo) GetName ¶
func (a *APIDocumentResourceInfo) GetName() string
func (*APIDocumentResourceInfo) GetNormalizedLabels ¶
func (a *APIDocumentResourceInfo) GetNormalizedLabels() map[string]string
type APIImplementationAdapter ¶
type APIImplementationAdapter struct {
// contains filtered or unexported fields
}
APIImplementationAdapter is a placeholder adapter for API implementations This resource type is not yet supported by the SDK
func NewAPIImplementationAdapter ¶
func NewAPIImplementationAdapter(client *state.Client) *APIImplementationAdapter
NewAPIImplementationAdapter creates a new API implementation adapter
func (*APIImplementationAdapter) Create ¶
func (a *APIImplementationAdapter) Create(_ context.Context, _ kkComps.CreateAPIVersionRequest, _ string) (string, error)
Create is not implemented
func (*APIImplementationAdapter) Delete ¶
func (a *APIImplementationAdapter) Delete(_ context.Context, _ string) error
Delete is not implemented
func (*APIImplementationAdapter) GetByName ¶
func (a *APIImplementationAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
GetByName is not implemented
func (*APIImplementationAdapter) MapCreateFields ¶
func (a *APIImplementationAdapter) MapCreateFields(_ context.Context, _ map[string]interface{}, _ *kkComps.CreateAPIVersionRequest) error
MapCreateFields is not implemented
func (*APIImplementationAdapter) MapUpdateFields ¶
func (a *APIImplementationAdapter) MapUpdateFields(_ context.Context, _ map[string]interface{}, _ *kkComps.APIVersion, _ map[string]string) error
MapUpdateFields is not implemented
func (*APIImplementationAdapter) RequiredFields ¶
func (a *APIImplementationAdapter) RequiredFields() []string
RequiredFields returns the required fields for creation
func (*APIImplementationAdapter) ResourceType ¶
func (a *APIImplementationAdapter) ResourceType() string
ResourceType returns the resource type name
func (*APIImplementationAdapter) SupportsUpdate ¶
func (a *APIImplementationAdapter) SupportsUpdate() bool
SupportsUpdate returns false as implementations are not supported
type APIImplementationResourceInfo ¶
type APIImplementationResourceInfo struct {
}
APIImplementationResourceInfo is a placeholder for API implementation resource info
func (*APIImplementationResourceInfo) GetID ¶
func (a *APIImplementationResourceInfo) GetID() string
func (*APIImplementationResourceInfo) GetLabels ¶
func (a *APIImplementationResourceInfo) GetLabels() map[string]string
func (*APIImplementationResourceInfo) GetName ¶
func (a *APIImplementationResourceInfo) GetName() string
func (*APIImplementationResourceInfo) GetNormalizedLabels ¶
func (a *APIImplementationResourceInfo) GetNormalizedLabels() map[string]string
type APIPublicationAdapter ¶
type APIPublicationAdapter struct {
// contains filtered or unexported fields
}
APIPublicationAdapter implements CreateDeleteOperations for API publications API publications only support create and delete operations, not updates
func NewAPIPublicationAdapter ¶
func NewAPIPublicationAdapter(client *state.Client) *APIPublicationAdapter
NewAPIPublicationAdapter creates a new API publication adapter
func (*APIPublicationAdapter) Create ¶
func (a *APIPublicationAdapter) Create(ctx context.Context, req kkComps.APIPublication, _ string) (string, error)
Create creates a new API publication
func (*APIPublicationAdapter) Delete ¶
func (a *APIPublicationAdapter) Delete(ctx context.Context, id string) error
Delete deletes an API publication
func (*APIPublicationAdapter) GetByName ¶
func (a *APIPublicationAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
GetByName gets an API publication by name
func (*APIPublicationAdapter) MapCreateFields ¶
func (a *APIPublicationAdapter) MapCreateFields(ctx context.Context, fields map[string]interface{}, create *kkComps.APIPublication) error
MapCreateFields maps fields to APIPublication
func (*APIPublicationAdapter) RequiredFields ¶
func (a *APIPublicationAdapter) RequiredFields() []string
RequiredFields returns the required fields for creation
func (*APIPublicationAdapter) ResourceType ¶
func (a *APIPublicationAdapter) ResourceType() string
ResourceType returns the resource type name
type APIPublicationResourceInfo ¶
type APIPublicationResourceInfo struct {
// contains filtered or unexported fields
}
APIPublicationResourceInfo implements ResourceInfo for API publications
func (*APIPublicationResourceInfo) GetID ¶
func (a *APIPublicationResourceInfo) GetID() string
func (*APIPublicationResourceInfo) GetLabels ¶
func (a *APIPublicationResourceInfo) GetLabels() map[string]string
func (*APIPublicationResourceInfo) GetName ¶
func (a *APIPublicationResourceInfo) GetName() string
func (*APIPublicationResourceInfo) GetNormalizedLabels ¶
func (a *APIPublicationResourceInfo) GetNormalizedLabels() map[string]string
type APIResourceInfo ¶
type APIResourceInfo struct {
// contains filtered or unexported fields
}
APIResourceInfo wraps an API to implement ResourceInfo
func (*APIResourceInfo) GetID ¶
func (a *APIResourceInfo) GetID() string
func (*APIResourceInfo) GetLabels ¶
func (a *APIResourceInfo) GetLabels() map[string]string
func (*APIResourceInfo) GetName ¶
func (a *APIResourceInfo) GetName() string
func (*APIResourceInfo) GetNormalizedLabels ¶
func (a *APIResourceInfo) GetNormalizedLabels() map[string]string
type APIVersionAdapter ¶
type APIVersionAdapter struct {
// contains filtered or unexported fields
}
APIVersionAdapter implements CreateDeleteOperations for API versions API versions only support create and delete operations, not updates
func NewAPIVersionAdapter ¶
func NewAPIVersionAdapter(client *state.Client) *APIVersionAdapter
NewAPIVersionAdapter creates a new API version adapter
func (*APIVersionAdapter) Create ¶
func (a *APIVersionAdapter) Create(ctx context.Context, req kkComps.CreateAPIVersionRequest, _ string) (string, error)
Create creates a new API version
func (*APIVersionAdapter) Delete ¶
func (a *APIVersionAdapter) Delete(ctx context.Context, id string) error
Delete deletes an API version
func (*APIVersionAdapter) GetByName ¶
func (a *APIVersionAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
GetByName gets an API version by name
func (*APIVersionAdapter) MapCreateFields ¶
func (a *APIVersionAdapter) MapCreateFields(_ context.Context, fields map[string]interface{}, create *kkComps.CreateAPIVersionRequest) error
MapCreateFields maps fields to CreateAPIVersionRequest
func (*APIVersionAdapter) RequiredFields ¶
func (a *APIVersionAdapter) RequiredFields() []string
RequiredFields returns the required fields for creation
func (*APIVersionAdapter) ResourceType ¶
func (a *APIVersionAdapter) ResourceType() string
ResourceType returns the resource type name
type APIVersionResourceInfo ¶
type APIVersionResourceInfo struct {
// contains filtered or unexported fields
}
APIVersionResourceInfo implements ResourceInfo for API versions
func (*APIVersionResourceInfo) GetID ¶
func (a *APIVersionResourceInfo) GetID() string
func (*APIVersionResourceInfo) GetLabels ¶
func (a *APIVersionResourceInfo) GetLabels() map[string]string
func (*APIVersionResourceInfo) GetName ¶
func (a *APIVersionResourceInfo) GetName() string
func (*APIVersionResourceInfo) GetNormalizedLabels ¶
func (a *APIVersionResourceInfo) GetNormalizedLabels() map[string]string
type AppliedChange ¶
type AppliedChange struct {
ChangeID string `json:"change_id"`
ResourceType string `json:"resource_type"`
ResourceName string `json:"resource_name"`
ResourceRef string `json:"resource_ref"`
Action string `json:"action"`
ResourceID string `json:"resource_id,omitempty"` // ID of created/updated resource
}
AppliedChange represents a successfully applied change
type AuthStrategyAdapter ¶
type AuthStrategyAdapter struct {
// contains filtered or unexported fields
}
AuthStrategyAdapter implements ResourceOperations for application auth strategies This adapter handles the complexity of union types in the SDK
func NewAuthStrategyAdapter ¶
func NewAuthStrategyAdapter(client *state.Client) *AuthStrategyAdapter
NewAuthStrategyAdapter creates a new auth strategy adapter
func (*AuthStrategyAdapter) Create ¶
func (a *AuthStrategyAdapter) Create(ctx context.Context, req kkComps.CreateAppAuthStrategyRequest, namespace string) (string, error)
Create creates a new auth strategy
func (*AuthStrategyAdapter) Delete ¶
func (a *AuthStrategyAdapter) Delete(ctx context.Context, id string) error
Delete deletes an auth strategy
func (*AuthStrategyAdapter) GetByName ¶
func (a *AuthStrategyAdapter) GetByName(ctx context.Context, name string) (ResourceInfo, error)
GetByName gets an auth strategy by name
func (*AuthStrategyAdapter) MapCreateFields ¶
func (a *AuthStrategyAdapter) MapCreateFields(ctx context.Context, fields map[string]interface{}, create *kkComps.CreateAppAuthStrategyRequest) error
MapCreateFields maps fields to the appropriate auth strategy request type Note: This returns interface{} because the SDK uses union types
func (*AuthStrategyAdapter) MapUpdateFields ¶
func (a *AuthStrategyAdapter) MapUpdateFields(ctx context.Context, fields map[string]interface{}, update *kkComps.UpdateAppAuthStrategyRequest, currentLabels map[string]string) error
MapUpdateFields maps fields to UpdateAppAuthStrategyRequest
func (*AuthStrategyAdapter) RequiredFields ¶
func (a *AuthStrategyAdapter) RequiredFields() []string
RequiredFields returns the required fields for creation
func (*AuthStrategyAdapter) ResourceType ¶
func (a *AuthStrategyAdapter) ResourceType() string
ResourceType returns the resource type name
func (*AuthStrategyAdapter) SupportsUpdate ¶
func (a *AuthStrategyAdapter) SupportsUpdate() bool
SupportsUpdate returns true as auth strategies support updates
type AuthStrategyResourceInfo ¶
type AuthStrategyResourceInfo struct {
// contains filtered or unexported fields
}
AuthStrategyResourceInfo wraps an ApplicationAuthStrategy to implement ResourceInfo
func (*AuthStrategyResourceInfo) GetID ¶
func (a *AuthStrategyResourceInfo) GetID() string
func (*AuthStrategyResourceInfo) GetLabels ¶
func (a *AuthStrategyResourceInfo) GetLabels() map[string]string
func (*AuthStrategyResourceInfo) GetName ¶
func (a *AuthStrategyResourceInfo) GetName() string
func (*AuthStrategyResourceInfo) GetNormalizedLabels ¶
func (a *AuthStrategyResourceInfo) GetNormalizedLabels() map[string]string
type BaseCreateDeleteExecutor ¶
type BaseCreateDeleteExecutor[TCreate any] struct { // contains filtered or unexported fields }
BaseCreateDeleteExecutor provides common operations for create/delete only resources
func NewBaseCreateDeleteExecutor ¶
func NewBaseCreateDeleteExecutor[TCreate any]( ops CreateDeleteOperations[TCreate], dryRun bool, ) *BaseCreateDeleteExecutor[TCreate]
NewBaseCreateDeleteExecutor creates a new executor for create/delete only resources
func (*BaseCreateDeleteExecutor[TCreate]) Create ¶
func (b *BaseCreateDeleteExecutor[TCreate]) Create(ctx context.Context, change planner.PlannedChange) (string, error)
Create handles CREATE operations
func (*BaseCreateDeleteExecutor[TCreate]) Delete ¶
func (b *BaseCreateDeleteExecutor[TCreate]) Delete(ctx context.Context, change planner.PlannedChange) error
Delete handles DELETE operations
type BaseExecutor ¶
BaseExecutor provides common CRUD operations
func NewBaseExecutor ¶
func NewBaseExecutor[TCreate any, TUpdate any]( ops ResourceOperations[TCreate, TUpdate], client *state.Client, dryRun bool, ) *BaseExecutor[TCreate, TUpdate]
NewBaseExecutor creates a new base executor instance
func (*BaseExecutor[TCreate, TUpdate]) Create ¶
func (b *BaseExecutor[TCreate, TUpdate]) Create(ctx context.Context, change planner.PlannedChange) (string, error)
Create handles CREATE operations for any resource type
func (*BaseExecutor[TCreate, TUpdate]) Delete ¶
func (b *BaseExecutor[TCreate, TUpdate]) Delete(ctx context.Context, change planner.PlannedChange) error
Delete handles DELETE operations for any resource type
func (*BaseExecutor[TCreate, TUpdate]) Update ¶
func (b *BaseExecutor[TCreate, TUpdate]) Update(ctx context.Context, change planner.PlannedChange) (string, error)
Update handles UPDATE operations for any resource type
type BaseSingletonExecutor ¶
type BaseSingletonExecutor[TUpdate any] struct { // contains filtered or unexported fields }
BaseSingletonExecutor provides common operations for singleton resources
func NewBaseSingletonExecutor ¶
func NewBaseSingletonExecutor[TUpdate any]( ops SingletonOperations[TUpdate], dryRun bool, ) *BaseSingletonExecutor[TUpdate]
NewBaseSingletonExecutor creates a new executor for singleton resources
func (*BaseSingletonExecutor[TUpdate]) Update ¶
func (b *BaseSingletonExecutor[TUpdate]) Update(ctx context.Context, change planner.PlannedChange, parentID string) (string, error)
Update handles both CREATE and UPDATE operations for singleton resources
type ConsoleReporter ¶
type ConsoleReporter struct {
// contains filtered or unexported fields
}
ConsoleReporter provides console output for plan execution progress
func NewConsoleReporter ¶
func NewConsoleReporter(w io.Writer) *ConsoleReporter
NewConsoleReporter creates a new console reporter that writes to the provided writer
func NewConsoleReporterWithOptions ¶
func NewConsoleReporterWithOptions(w io.Writer, dryRun bool) *ConsoleReporter
NewConsoleReporterWithOptions creates a new console reporter with options
func (*ConsoleReporter) CompleteChange ¶
func (r *ConsoleReporter) CompleteChange(change planner.PlannedChange, err error)
CompleteChange is called after a change is executed (success or failure)
func (*ConsoleReporter) FinishExecution ¶
func (r *ConsoleReporter) FinishExecution(result *ExecutionResult)
FinishExecution is called at the end of plan execution
func (*ConsoleReporter) SkipChange ¶
func (r *ConsoleReporter) SkipChange(change planner.PlannedChange, reason string)
SkipChange is called when a change is skipped
func (*ConsoleReporter) StartChange ¶
func (r *ConsoleReporter) StartChange(change planner.PlannedChange)
StartChange is called before executing a change
func (*ConsoleReporter) StartExecution ¶
func (r *ConsoleReporter) StartExecution(plan *planner.Plan)
StartExecution is called at the beginning of plan execution
type CreateDeleteOperations ¶
type CreateDeleteOperations[TCreate any] interface { // Field mapping MapCreateFields(ctx context.Context, fields map[string]interface{}, create *TCreate) error // API calls Create(ctx context.Context, req TCreate, namespace string) (string, error) Delete(ctx context.Context, id string) error GetByName(ctx context.Context, name string) (ResourceInfo, error) // Resource info ResourceType() string RequiredFields() []string }
CreateDeleteOperations defines operations for resources that only support create and delete (no update operation), such as API versions and API publications
type ExecutionError ¶
type ExecutionError struct {
ChangeID string `json:"change_id"`
ResourceType string `json:"resource_type"`
ResourceName string `json:"resource_name"`
ResourceRef string `json:"resource_ref"`
Action string `json:"action"`
Error string `json:"error"`
}
ExecutionError represents an error that occurred during execution
type ExecutionResult ¶
type ExecutionResult struct {
// Counts
SuccessCount int `json:"success_count"`
FailureCount int `json:"failure_count"`
SkippedCount int `json:"skipped_count"`
// Errors encountered during execution
Errors []ExecutionError `json:"errors,omitempty"`
// Indicates if this was a dry-run execution
DryRun bool `json:"dry_run"`
// Changes that were successfully applied (empty in dry-run)
ChangesApplied []AppliedChange `json:"changes_applied,omitempty"`
// Validation results for dry-run mode
ValidationResults []ValidationResult `json:"validation_results,omitempty"`
}
ExecutionResult represents the outcome of executing a plan
func (*ExecutionResult) HasErrors ¶
func (r *ExecutionResult) HasErrors() bool
HasErrors returns true if any errors occurred during execution
func (*ExecutionResult) Message ¶
func (r *ExecutionResult) Message() string
Message returns a user-friendly summary of the execution result
func (*ExecutionResult) TotalChanges ¶
func (r *ExecutionResult) TotalChanges() int
TotalChanges returns the total number of changes processed
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor handles the execution of declarative configuration plans
type ParentAwareOperations ¶
type ParentAwareOperations[TCreate any, TUpdate any] interface { ResourceOperations[TCreate, TUpdate] // Parent resolution ResolveParentID(ctx context.Context, change planner.PlannedChange, executor *Executor) (string, error) }
ParentAwareOperations extends ResourceOperations for resources with parent relationships
type PortalAdapter ¶
type PortalAdapter struct {
// contains filtered or unexported fields
}
PortalAdapter implements ResourceOperations for portals
func NewPortalAdapter ¶
func NewPortalAdapter(client *state.Client) *PortalAdapter
NewPortalAdapter creates a new portal adapter
func (*PortalAdapter) Create ¶
func (p *PortalAdapter) Create(ctx context.Context, req kkComps.CreatePortal, namespace string) (string, error)
Create creates a new portal
func (*PortalAdapter) Delete ¶
func (p *PortalAdapter) Delete(ctx context.Context, id string) error
Delete deletes a portal
func (*PortalAdapter) GetByName ¶
func (p *PortalAdapter) GetByName(ctx context.Context, name string) (ResourceInfo, error)
GetByName gets a portal by name
func (*PortalAdapter) MapCreateFields ¶
func (p *PortalAdapter) MapCreateFields(ctx context.Context, fields map[string]interface{}, create *kkComps.CreatePortal) error
MapCreateFields maps fields to CreatePortal request
func (*PortalAdapter) MapUpdateFields ¶
func (p *PortalAdapter) MapUpdateFields(ctx context.Context, fields map[string]interface{}, update *kkComps.UpdatePortal, currentLabels map[string]string) error
MapUpdateFields maps fields to UpdatePortal request
func (*PortalAdapter) RequiredFields ¶
func (p *PortalAdapter) RequiredFields() []string
RequiredFields returns the required fields for creation
func (*PortalAdapter) ResourceType ¶
func (p *PortalAdapter) ResourceType() string
ResourceType returns the resource type name
func (*PortalAdapter) SupportsUpdate ¶
func (p *PortalAdapter) SupportsUpdate() bool
SupportsUpdate returns true as portals support updates
type PortalCustomizationAdapter ¶
type PortalCustomizationAdapter struct {
// contains filtered or unexported fields
}
PortalCustomizationAdapter implements SingletonOperations for portal customization Portal customization is a singleton resource that always exists and only supports updates
func NewPortalCustomizationAdapter ¶
func NewPortalCustomizationAdapter(client *state.Client) *PortalCustomizationAdapter
NewPortalCustomizationAdapter creates a new portal customization adapter
func (*PortalCustomizationAdapter) MapUpdateFields ¶
func (p *PortalCustomizationAdapter) MapUpdateFields(_ context.Context, fields map[string]interface{}, update *kkComps.PortalCustomization) error
MapUpdateFields maps fields to PortalCustomization
func (*PortalCustomizationAdapter) ResourceType ¶
func (p *PortalCustomizationAdapter) ResourceType() string
ResourceType returns the resource type name
func (*PortalCustomizationAdapter) Update ¶
func (p *PortalCustomizationAdapter) Update(ctx context.Context, portalID string, req kkComps.PortalCustomization) error
Update updates the portal customization
type PortalDomainAdapter ¶
type PortalDomainAdapter struct {
// contains filtered or unexported fields
}
PortalDomainAdapter implements ResourceOperations for portal custom domains
func NewPortalDomainAdapter ¶
func NewPortalDomainAdapter(client *state.Client) *PortalDomainAdapter
NewPortalDomainAdapter creates a new portal domain adapter
func (*PortalDomainAdapter) Create ¶
func (p *PortalDomainAdapter) Create(ctx context.Context, req kkComps.CreatePortalCustomDomainRequest, _ string) (string, error)
Create creates a new portal custom domain
func (*PortalDomainAdapter) Delete ¶
func (p *PortalDomainAdapter) Delete(ctx context.Context, id string) error
Delete deletes a portal custom domain
func (*PortalDomainAdapter) GetByName ¶
func (p *PortalDomainAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
GetByName gets a portal custom domain by name (hostname)
func (*PortalDomainAdapter) MapCreateFields ¶
func (p *PortalDomainAdapter) MapCreateFields(_ context.Context, fields map[string]interface{}, create *kkComps.CreatePortalCustomDomainRequest) error
MapCreateFields maps fields to CreatePortalCustomDomainRequest
func (*PortalDomainAdapter) MapUpdateFields ¶
func (p *PortalDomainAdapter) MapUpdateFields(_ context.Context, fields map[string]interface{}, update *kkComps.UpdatePortalCustomDomainRequest, _ map[string]string) error
MapUpdateFields maps fields to UpdatePortalCustomDomainRequest
func (*PortalDomainAdapter) RequiredFields ¶
func (p *PortalDomainAdapter) RequiredFields() []string
RequiredFields returns the required fields for creation
func (*PortalDomainAdapter) ResourceType ¶
func (p *PortalDomainAdapter) ResourceType() string
ResourceType returns the resource type name
func (*PortalDomainAdapter) SupportsUpdate ¶
func (p *PortalDomainAdapter) SupportsUpdate() bool
SupportsUpdate returns true as custom domains support updates (enabled field only)
type PortalDomainResourceInfo ¶
type PortalDomainResourceInfo struct {
// contains filtered or unexported fields
}
PortalDomainResourceInfo implements ResourceInfo for portal custom domains
func (*PortalDomainResourceInfo) GetID ¶
func (p *PortalDomainResourceInfo) GetID() string
func (*PortalDomainResourceInfo) GetLabels ¶
func (p *PortalDomainResourceInfo) GetLabels() map[string]string
func (*PortalDomainResourceInfo) GetName ¶
func (p *PortalDomainResourceInfo) GetName() string
func (*PortalDomainResourceInfo) GetNormalizedLabels ¶
func (p *PortalDomainResourceInfo) GetNormalizedLabels() map[string]string
type PortalPageAdapter ¶
type PortalPageAdapter struct {
// contains filtered or unexported fields
}
PortalPageAdapter implements ResourceOperations for portal pages
func NewPortalPageAdapter ¶
func NewPortalPageAdapter(client *state.Client) *PortalPageAdapter
NewPortalPageAdapter creates a new portal page adapter
func (*PortalPageAdapter) Create ¶
func (p *PortalPageAdapter) Create(ctx context.Context, req kkComps.CreatePortalPageRequest, _ string) (string, error)
Create creates a new portal page
func (*PortalPageAdapter) Delete ¶
func (p *PortalPageAdapter) Delete(ctx context.Context, id string) error
Delete deletes a portal page
func (*PortalPageAdapter) GetByName ¶
func (p *PortalPageAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
GetByName gets a portal page by slug
func (*PortalPageAdapter) MapCreateFields ¶
func (p *PortalPageAdapter) MapCreateFields(ctx context.Context, fields map[string]interface{}, create *kkComps.CreatePortalPageRequest) error
MapCreateFields maps fields to CreatePortalPageRequest
func (*PortalPageAdapter) MapUpdateFields ¶
func (p *PortalPageAdapter) MapUpdateFields(ctx context.Context, fields map[string]interface{}, update *kkComps.UpdatePortalPageRequest, _ map[string]string) error
MapUpdateFields maps fields to UpdatePortalPageRequest
func (*PortalPageAdapter) RequiredFields ¶
func (p *PortalPageAdapter) RequiredFields() []string
RequiredFields returns the required fields for creation
func (*PortalPageAdapter) ResourceType ¶
func (p *PortalPageAdapter) ResourceType() string
ResourceType returns the resource type name
func (*PortalPageAdapter) SupportsUpdate ¶
func (p *PortalPageAdapter) SupportsUpdate() bool
SupportsUpdate returns true as pages support updates
type PortalPageResourceInfo ¶
type PortalPageResourceInfo struct {
// contains filtered or unexported fields
}
PortalPageResourceInfo implements ResourceInfo for portal pages
func (*PortalPageResourceInfo) GetID ¶
func (p *PortalPageResourceInfo) GetID() string
func (*PortalPageResourceInfo) GetLabels ¶
func (p *PortalPageResourceInfo) GetLabels() map[string]string
func (*PortalPageResourceInfo) GetName ¶
func (p *PortalPageResourceInfo) GetName() string
func (*PortalPageResourceInfo) GetNormalizedLabels ¶
func (p *PortalPageResourceInfo) GetNormalizedLabels() map[string]string
type PortalResourceInfo ¶
type PortalResourceInfo struct {
// contains filtered or unexported fields
}
PortalResourceInfo wraps a Portal to implement ResourceInfo
func (*PortalResourceInfo) GetID ¶
func (p *PortalResourceInfo) GetID() string
func (*PortalResourceInfo) GetLabels ¶
func (p *PortalResourceInfo) GetLabels() map[string]string
func (*PortalResourceInfo) GetName ¶
func (p *PortalResourceInfo) GetName() string
func (*PortalResourceInfo) GetNormalizedLabels ¶
func (p *PortalResourceInfo) GetNormalizedLabels() map[string]string
type PortalSnippetAdapter ¶
type PortalSnippetAdapter struct {
// contains filtered or unexported fields
}
PortalSnippetAdapter implements ResourceOperations for portal snippets
func NewPortalSnippetAdapter ¶
func NewPortalSnippetAdapter(client *state.Client) *PortalSnippetAdapter
NewPortalSnippetAdapter creates a new portal snippet adapter
func (*PortalSnippetAdapter) Create ¶
func (p *PortalSnippetAdapter) Create(ctx context.Context, req kkComps.CreatePortalSnippetRequest, _ string) (string, error)
Create creates a new portal snippet
func (*PortalSnippetAdapter) Delete ¶
func (p *PortalSnippetAdapter) Delete(ctx context.Context, id string) error
Delete deletes a portal snippet
func (*PortalSnippetAdapter) GetByName ¶
func (p *PortalSnippetAdapter) GetByName(_ context.Context, _ string) (ResourceInfo, error)
GetByName gets a portal snippet by name
func (*PortalSnippetAdapter) MapCreateFields ¶
func (p *PortalSnippetAdapter) MapCreateFields(_ context.Context, fields map[string]interface{}, create *kkComps.CreatePortalSnippetRequest) error
MapCreateFields maps fields to CreatePortalSnippetRequest
func (*PortalSnippetAdapter) MapUpdateFields ¶
func (p *PortalSnippetAdapter) MapUpdateFields(_ context.Context, fields map[string]interface{}, update *kkComps.UpdatePortalSnippetRequest, _ map[string]string) error
MapUpdateFields maps fields to UpdatePortalSnippetRequest
func (*PortalSnippetAdapter) RequiredFields ¶
func (p *PortalSnippetAdapter) RequiredFields() []string
RequiredFields returns the required fields for creation
func (*PortalSnippetAdapter) ResourceType ¶
func (p *PortalSnippetAdapter) ResourceType() string
ResourceType returns the resource type name
func (*PortalSnippetAdapter) SupportsUpdate ¶
func (p *PortalSnippetAdapter) SupportsUpdate() bool
SupportsUpdate returns true as snippets support updates
type PortalSnippetResourceInfo ¶
type PortalSnippetResourceInfo struct {
// contains filtered or unexported fields
}
PortalSnippetResourceInfo implements ResourceInfo for portal snippets
func (*PortalSnippetResourceInfo) GetID ¶
func (p *PortalSnippetResourceInfo) GetID() string
func (*PortalSnippetResourceInfo) GetLabels ¶
func (p *PortalSnippetResourceInfo) GetLabels() map[string]string
func (*PortalSnippetResourceInfo) GetName ¶
func (p *PortalSnippetResourceInfo) GetName() string
func (*PortalSnippetResourceInfo) GetNormalizedLabels ¶
func (p *PortalSnippetResourceInfo) GetNormalizedLabels() map[string]string
type ProgressReporter ¶
type ProgressReporter interface {
// StartExecution is called at the beginning of plan execution
StartExecution(plan *planner.Plan)
// StartChange is called before executing a change
StartChange(change planner.PlannedChange)
// CompleteChange is called after a change is executed (success or failure)
CompleteChange(change planner.PlannedChange, err error)
// SkipChange is called when a change is skipped (e.g., in dry-run mode)
SkipChange(change planner.PlannedChange, reason string)
// FinishExecution is called at the end of plan execution
FinishExecution(result *ExecutionResult)
}
ProgressReporter provides real-time feedback during plan execution
type ResourceInfo ¶
type ResourceInfo interface {
GetID() string
GetName() string
GetLabels() map[string]string
GetNormalizedLabels() map[string]string
}
ResourceInfo provides common resource information
type ResourceOperations ¶
type ResourceOperations[TCreate any, TUpdate any] interface { // Field mapping MapCreateFields(ctx context.Context, fields map[string]interface{}, create *TCreate) error MapUpdateFields(ctx context.Context, fields map[string]interface{}, update *TUpdate, currentLabels map[string]string) error // API calls Create(ctx context.Context, req TCreate, namespace string) (string, error) Update(ctx context.Context, id string, req TUpdate, namespace string) (string, error) Delete(ctx context.Context, id string) error GetByName(ctx context.Context, name string) (ResourceInfo, error) // Resource info ResourceType() string RequiredFields() []string SupportsUpdate() bool }
ResourceOperations defines the contract for resource-specific operations
type SingletonOperations ¶
type SingletonOperations[TUpdate any] interface { // Field mapping MapUpdateFields(ctx context.Context, fields map[string]interface{}, update *TUpdate) error // API calls - note the special signature for singleton resources Update(ctx context.Context, parentID string, req TUpdate) error // Resource info ResourceType() string }
SingletonOperations defines operations for singleton resources that always exist and only support updates (no create/delete), such as portal customization
type ValidationResult ¶
type ValidationResult struct {
ChangeID string `json:"change_id"`
ResourceType string `json:"resource_type"`
ResourceName string `json:"resource_name"`
ResourceRef string `json:"resource_ref"`
Action string `json:"action"`
Status string `json:"status"` // "would_succeed", "would_fail", "skipped"
Validation string `json:"validation,omitempty"` // "passed", "failed", reason
Message string `json:"message,omitempty"`
}
ValidationResult represents the validation outcome for a change in dry-run mode
Source Files
¶
- api_adapter.go
- api_document_adapter.go
- api_document_operations.go
- api_implementation_adapter.go
- api_implementation_operations.go
- api_operations.go
- api_publication_adapter.go
- api_publication_operations.go
- api_version_adapter.go
- api_version_operations.go
- auth_strategy_adapter.go
- auth_strategy_operations.go
- base_executor.go
- base_operations.go
- executor.go
- portal_adapter.go
- portal_child_operations.go
- portal_customization_adapter.go
- portal_domain_adapter.go
- portal_operations.go
- portal_page_adapter.go
- portal_snippet_adapter.go
- progress.go
- types.go