validation

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateDownstreamTargets

func ValidateDownstreamTargets(targets []runsv1alpha1.DownstreamTarget) error

ValidateDownstreamTargets ensures each target selects exactly one transport mode and validates GRPC endpoint format.

Behavior:

  • Returns an error if a target does not set exactly one of grpc or terminate.
  • For GRPC targets, validates that the endpoint is a valid host:port format.
  • Supports both DNS names (service.namespace.svc:9000) and IP addresses.

Arguments:

  • targets []runsv1alpha1.DownstreamTarget: the list of downstream targets to validate.

Returns:

  • error: describes the first validation failure, or nil if all targets are valid.

func ValidateGRPCEndpoint

func ValidateGRPCEndpoint(endpoint string) error

ValidateGRPCEndpoint validates that an endpoint string is a valid gRPC target address.

Behavior:

  • Accepts formats: "host:port", "hostname.namespace.svc:port", "ip:port".
  • Rejects empty endpoints, missing ports, and invalid port numbers.
  • Does not require the endpoint to be reachable (syntax check only).

Arguments:

  • endpoint string: the gRPC endpoint to validate.

Returns:

  • error: describes the validation failure, or nil if the endpoint is valid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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