validation

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResourceNamePattern is the regex pattern that resource names must follow
	ResourceNamePattern = "^[a-z0-9][a-z0-9-]*[a-z0-9]$"
)

Variables

This section is empty.

Functions

func ValidateComponentName

func ValidateComponentName(val interface{}) error

ValidateComponentName validates a component name

func ValidateGitHubURL

func ValidateGitHubURL(urlStr string) error

ValidateGitHubURL validates that a URL is a proper GitHub repository URL

func ValidateName

func ValidateName(resourceType string, val interface{}) error

ValidateName validates that a resource name follows the required pattern

func ValidateNamespaceName added in v0.13.0

func ValidateNamespaceName(val interface{}) error

ValidateNamespaceName validates an namespace name

func ValidateParams

func ValidateParams(cmdType CommandType, resource ResourceType, params interface{}) error

ValidateParams validates command parameters based on command and resource types

func ValidateProjectName

func ValidateProjectName(val interface{}) error

ValidateProjectName validates a project name

func ValidateURL

func ValidateURL(val interface{}) error

ValidateURL validates a generic URL

Types

type CommandType

type CommandType string

CommandType represents the type of CLI command

const (
	CmdCreate CommandType = "create"
	CmdGet    CommandType = "get"
	CmdList   CommandType = "list"
	CmdLogs   CommandType = "logs"
	CmdApply  CommandType = "apply"
	CmdDelete CommandType = "delete"
	CmdDeploy CommandType = "deploy"
)

type NamespaceProvider added in v0.13.0

type NamespaceProvider interface {
	GetNamespace() string
}

NamespaceProvider is an interface for params that have a Namespace field

type ResourceType

type ResourceType string

ResourceType represents the resource being managed

const (
	ResourceProject              ResourceType = "project"
	ResourceComponent            ResourceType = "component"
	ResourceBuild                ResourceType = "build"
	ResourceDeployment           ResourceType = "deployment"
	ResourceDeploymentTrack      ResourceType = "deploymenttrack"
	ResourceEnvironment          ResourceType = "environment"
	ResourceDeployableArtifact   ResourceType = "deployableartifact"
	ResourceEndpoint             ResourceType = "endpoint"
	ResourceNamespace            ResourceType = "namespace"
	ResourceDataPlane            ResourceType = "dataplane"
	ResourceBuildPlane           ResourceType = "buildplane"
	ResourceObservabilityPlane   ResourceType = "observabilityplane"
	ResourceComponentType        ResourceType = "componenttype"
	ResourceTrait                ResourceType = "trait"
	ResourceWorkflow             ResourceType = "workflow"
	ResourceComponentWorkflow    ResourceType = "componentworkflow"
	ResourceSecretReference      ResourceType = "secretreference"
	ResourceLogs                 ResourceType = "logs"
	ResourceApply                ResourceType = "apply"
	ResourceDelete               ResourceType = "delete"
	ResourceDeploymentPipeline   ResourceType = "deploymentpipeline"
	ResourceConfigurationGroup   ResourceType = "configurationgroup"
	ResourceWorkload             ResourceType = "workload"
	ResourceComponentRelease     ResourceType = "componentrelease"
	ResourceReleaseBinding       ResourceType = "releasebinding"
	ResourceWorkflowRun          ResourceType = "workflowrun"
	ResourceComponentWorkflowRun ResourceType = "componentworkflowrun"
)

Jump to

Keyboard shortcuts

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