Help us shape the future of Go! Take the 2026 Go Developer Survey

validators

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package validators contains reusable Zerops schema constraints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmbiguousServiceFamily added in v0.1.2

func AmbiguousServiceFamily(name string, families map[string]bool) string

AmbiguousServiceFamily returns the lowercase catalogue key for dual-mode shorthand, without exposing a configured version or spelling.

func AmbiguousServiceMode added in v0.1.2

func AmbiguousServiceMode(name string, families map[string]bool) string

AmbiguousServiceMode returns a diagnostic detail only for dual-mode shorthand.

func CIDROrIP

func CIDROrIP() validator.String

func Domain

func Domain() validator.String

func DualModeFamilies added in v0.1.2

func DualModeFamilies(settings *client.Settings) map[string]bool

DualModeFamilies derives availability choices from qualified catalogue versions. A nil catalogue uses the 2026-10-29 production/dev catalogue snapshot only when the catalogue cannot be read (including before provider configuration).

func EnvKey

func EnvKey() validator.String

func GitBranch

func GitBranch() validator.String

func Hostname

func Hostname() validator.String

func Isolation

func Isolation(ssh bool) validator.String

Isolation validates token structure without freezing the server's extensible vocabulary.

func MinMax

func MinMax(min, max string) validator.Object

MinMax compares named numeric leaves of a single nested object; unknown leaves defer validation.

func NonEmptyObject

func NonEmptyObject() validator.Object

func Port

func Port() validator.Int64

func PositiveDecimalString

func PositiveDecimalString() validator.String

func PositiveDuration

func PositiveDuration() validator.String

PositiveDuration validates explicit timeout values before an operation begins.

func Precision

func Precision() validator.Number

Precision limits configured numbers without rounding server readback values.

func PublicPort

func PublicPort() validator.Int64

func ServiceType

func ServiceType() validator.String

func TimeoutsBlock

func TimeoutsBlock(ctx context.Context, opts timeouts.Opts) schema.Block

TimeoutsBlock retains the framework-timeouts custom value type while adding positive duration validation and Markdown descriptions to its optional block.

Types

This section is empty.

Jump to

Keyboard shortcuts

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