validation

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 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 ValidateOrganizationName

func ValidateOrganizationName(val interface{}) error

ValidateOrganizationName validates an organization 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"
	CmdLogs   CommandType = "logs"
	CmdApply  CommandType = "apply"
)

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"
	ResourceOrganization       ResourceType = "organization"
	ResourceDataPlane          ResourceType = "dataplane"
	ResourceLogs               ResourceType = "logs"
	ResourceApply              ResourceType = "apply"
	ResourceDeploymentPipeline ResourceType = "deploymentpipeline"
	ResourceConfigurationGroup ResourceType = "configurationgroup"
)

Jump to

Keyboard shortcuts

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