Skip to main content

Module validate

Module validate 

Source
Expand description

Validation functions for ZLayer deployment specifications

This module provides validators for all spec fields with proper error reporting.

Functions§

validate_cpu
Validate CPU limit
validate_cpu_option_wrapper
Wrapper for validate_cpu for use with validator crate Note: For Option<f64> fields, validator crate unwraps and passes the inner f64
validate_cron_schedules
Validate schedule/rtype consistency for all services
validate_dependencies
Validate that all dependency service references exist
validate_deployment_name
Validate a deployment name
validate_deployment_name_wrapper
Wrapper for validate_deployment_name for use with validator crate
validate_endpoint_tunnel_config
Validate an EndpointTunnelConfig
validate_env_vars
Validate all environment variable values in a service spec
validate_image_name
Validate an image name
validate_memory_format
Validate memory format
validate_memory_option_wrapper
Wrapper for validate_memory_format for use with validator crate Note: For Option<String> fields, validator crate unwraps and passes &String
validate_port
Validate a port number
validate_port_wrapper
Wrapper for validate_port for use with validator crate Note: validator crate passes primitive types by value for custom validators
validate_scale_range
Validate scale range
validate_scale_spec
Validate scale range (min <= max) for ScaleSpec
validate_schedule_wrapper
Wrapper for validate_cron_schedule for use with validator crate Note: For Option<String> fields, validator crate unwraps and passes &String
validate_secret_reference
Validate a secret reference name format
validate_service_schedule
Validate schedule/rtype consistency for a single service
validate_storage_name
Validate storage name format (lowercase alphanumeric with hyphens)
validate_storage_name_wrapper
Wrapper for validate_storage_name for use with validator crate
validate_tunnel_access_config
Validate a TunnelAccessConfig
validate_tunnel_definition
Validate a top-level TunnelDefinition
validate_tunnel_ttl
Validate tunnel TTL format (e.g., “4h”, “30m”, “1d”)
validate_tunnels
Validate all tunnels in a deployment spec
validate_unique_endpoints
Validate that endpoint names are unique within a service
validate_unique_service_endpoints
Validate that each service has unique endpoint names
validate_version
Validate that the version is “v1”
validate_version_wrapper
Wrapper for validate_version for use with validator crate
validate_wasm_config
Validate WASM configuration for a single service
validate_wasm_configs
Validate WASM configuration for all services in a deployment spec