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

validators

package
v0.25.4 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildingBlockDefinitionApprovals added in v0.25.2

type BuildingBlockDefinitionApprovals struct{}

BuildingBlockDefinitionApprovals rejects an enabled approval gate on an implementation without dry runs. Approving a run means reviewing what it would change, and only a dry run can show that.

func (BuildingBlockDefinitionApprovals) Description added in v0.25.2

func (BuildingBlockDefinitionApprovals) MarkdownDescription added in v0.25.2

func (v BuildingBlockDefinitionApprovals) MarkdownDescription(ctx context.Context) string

func (BuildingBlockDefinitionApprovals) ValidateObject added in v0.25.2

type BuildingBlockDefinitionSchedule added in v0.25.2

type BuildingBlockDefinitionSchedule struct{}

BuildingBlockDefinitionSchedule rejects an internally inconsistent drift schedule, and one the version's implementation cannot run.

func (BuildingBlockDefinitionSchedule) Description added in v0.25.2

func (BuildingBlockDefinitionSchedule) MarkdownDescription added in v0.25.2

func (v BuildingBlockDefinitionSchedule) MarkdownDescription(ctx context.Context) string

func (BuildingBlockDefinitionSchedule) ValidateObject added in v0.25.2

type BuildingBlockDefinitionTagInputs added in v0.25.2

type BuildingBlockDefinitionTagInputs struct{}

BuildingBlockDefinitionTagInputs repeats meshStack's rules for a tag-sourced input at plan time, for the same reason as the two validators above: the resource writes the definition before the version that carries the inputs, so a backend rejection arrives after the definition already exists.

It stops at what the configuration can prove. Whether the named tag exists in the tag schema takes a read against meshStack, so that one is left there.

func (BuildingBlockDefinitionTagInputs) Description added in v0.25.2

func (BuildingBlockDefinitionTagInputs) MarkdownDescription added in v0.25.2

func (v BuildingBlockDefinitionTagInputs) MarkdownDescription(ctx context.Context) string

func (BuildingBlockDefinitionTagInputs) ValidateMap added in v0.25.2

type DiscriminatedAttributesValidator added in v0.23.0

type DiscriminatedAttributesValidator struct {
	// Discriminator is the name of the string attribute whose value selects the required attribute.
	Discriminator string
	// RequiredFor maps a discriminator value to the attribute that must be set for that value.
	RequiredFor map[string]string
}

DiscriminatedAttributesValidator validates a discriminated-union object: the string value of the Discriminator attribute selects which one of the controlled attributes must be set, and requires every other controlled attribute to be null.

The controlled set is the set of attribute names in RequiredFor's values. Discriminator values not present in RequiredFor are ignored (validate the discriminator itself with stringvalidator.OneOf). Null/unknown objects and unknown attribute values are skipped.

func (DiscriminatedAttributesValidator) Description added in v0.23.0

func (DiscriminatedAttributesValidator) MarkdownDescription added in v0.23.0

func (v DiscriminatedAttributesValidator) MarkdownDescription(ctx context.Context) string

func (DiscriminatedAttributesValidator) ValidateObject added in v0.23.0

type ExactlyOneAttributeValidator added in v0.18.2

type ExactlyOneAttributeValidator struct{}

func (ExactlyOneAttributeValidator) Description added in v0.18.2

func (ExactlyOneAttributeValidator) MarkdownDescription added in v0.18.2

func (v ExactlyOneAttributeValidator) MarkdownDescription(ctx context.Context) string

func (ExactlyOneAttributeValidator) ValidateObject added in v0.18.2

type SupportedPlatforms

type SupportedPlatforms struct{}

func (SupportedPlatforms) Description

func (v SupportedPlatforms) Description(ctx context.Context) string

func (SupportedPlatforms) MarkdownDescription

func (v SupportedPlatforms) MarkdownDescription(ctx context.Context) string

func (SupportedPlatforms) ValidateSet

type SymbolSize added in v0.20.2

type SymbolSize struct{}

SymbolSize validates the format and size of a building block definition symbol.

The value must be either:

  • an http:// or https:// URL, or
  • a data URI with one of the allowed image prefixes (png, jpeg, jpg, gif, webp, svg+xml).

For data URIs, the base64 payload must be valid and the decoded size must not exceed 100 KiB.

func (SymbolSize) Description added in v0.20.2

func (v SymbolSize) Description(_ context.Context) string

func (SymbolSize) MarkdownDescription added in v0.20.2

func (v SymbolSize) MarkdownDescription(ctx context.Context) string

func (SymbolSize) ValidateString added in v0.20.2

func (v SymbolSize) ValidateString(_ context.Context, req validator.StringRequest, resp *validator.StringResponse)

Jump to

Keyboard shortcuts

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