proofing

package
v0.94.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidatePresence

func ValidatePresence(err error, v any, field string) error

Types

type CollectionPropertyBlueprint

type CollectionPropertyBlueprint struct {
	SimplePropertyBlueprint `yaml:",inline"`

	PropertyBlueprints []SimplePropertyBlueprint `yaml:"property_blueprints"`
	NamedManifests     []NamedManifest           `yaml:"named_manifests"`
}

type CollectionPropertyInput

type CollectionPropertyInput struct {
	SimplePropertyInput `yaml:",inline"`

	PropertyInputs []CollectionSubfieldPropertyInput `yaml:"property_inputs"`
}

func (CollectionPropertyInput) Ref added in v0.77.2

func (input CollectionPropertyInput) Ref() string

type CollectionSubfieldPropertyInput

type CollectionSubfieldPropertyInput struct {
	SimplePropertyInput `yaml:",inline"`

	Slug bool `yaml:"slug"`
}

type CompoundError

type CompoundError []error

func (*CompoundError) Add

func (ce *CompoundError) Add(err error)

func (*CompoundError) Error

func (ce *CompoundError) Error() string

type ErrandTemplate

type ErrandTemplate struct {
	Name        string   `yaml:"name"`
	Colocated   bool     `yaml:"colocated"`
	RunDefault  bool     `yaml:"run_default"`
	Instances   []string `yaml:"instances"` // TODO: how to validate?
	Label       string   `yaml:"label"`
	Description string   `yaml:"description"`
}

type FormType

type FormType struct {
	Verifiers      []VerifierBlueprint `yaml:"verifiers,omitempty"`
	PropertyInputs PropertyInputs      `yaml:"property_inputs"`

	Name        string `yaml:"name"`
	Label       string `yaml:"label"`
	Description string `yaml:"description"`
	Markdown    string `yaml:"markdown,omitempty"`
}

type InstallTimeVerifier

type InstallTimeVerifier struct {
	Ignorable  bool   `yaml:"ignorable,omitempty"`
	Name       string `yaml:"name"`
	Properties any    `yaml:"properties"` // TODO: schema?
}

type InstanceDefinition

type InstanceDefinition struct {
	Default      int                 `yaml:"default"`
	Configurable bool                `yaml:"configurable"`
	Constraints  *IntegerConstraints `yaml:"constraints,omitempty"`
	ZeroIf       ZeroIfBinding       `yaml:"zero_if,omitempty"` // TODO: schema?

}

type IntegerConstraints added in v0.85.0

type IntegerConstraints struct {
	Min       *int `yaml:"min"`
	Max       *int `yaml:"max"`
	ZeroOrMin *int `yaml:"zero_or_min"`
	Modulo    *int `yaml:"modulo"`

	PowerOfTwo         *bool `yaml:"power_of_two"`
	MayOnlyIncrease    *bool `yaml:"may_only_increase"`
	MayOnlyBeOddOrZero *bool `yaml:"may_only_be_odd_or_zero"`
}

func (IntegerConstraints) CheckValue added in v0.85.0

func (constraints IntegerConstraints) CheckValue(value int) error

type JobType

type JobType struct {
	Name          string `yaml:"name"`
	ResourceLabel string `yaml:"resource_label"`
	Description   string `yaml:"description,omitempty"`

	Manifest    string `yaml:"manifest"`
	MaxInFlight any    `yaml:"max_in_flight"`

	Canaries     int  `yaml:"canaries"`
	Serial       bool `yaml:"serial,omitempty"`
	SingleAZOnly bool `yaml:"single_az_only"`

	Errand                     bool `yaml:"errand"`
	RunPreDeleteErrandDefault  bool `yaml:"run_pre_delete_errand_default"`
	RunPostDeployErrandDefault bool `yaml:"run_post_deploy_errand_default"`

	Templates               []Template           `yaml:"templates"`
	InstanceDefinition      InstanceDefinition   `yaml:"instance_definition"`
	ResourceDefinitions     []ResourceDefinition `yaml:"resource_definitions"`
	PropertyBlueprints      PropertyBlueprints   `yaml:"property_blueprints,omitempty"`
	RequiresProductVersions []ProductVersion     `yaml:"requires_product_versions"`
}

type NamedManifest

type NamedManifest struct {
	Name     string `yaml:"name"`
	Manifest string `yaml:"manifest"`
}

type ProductTemplate

type ProductTemplate struct {
	Name                     string `yaml:"name"`
	ProductVersion           string `yaml:"product_version"`
	MinimumVersionForUpgrade string `yaml:"minimum_version_for_upgrade"`
	Label                    string `yaml:"label"`
	Rank                     int    `yaml:"rank"`
	MetadataVersion          string `yaml:"metadata_version"`
	OriginalMetadataVersion  string `yaml:"original_metadata_version"`
	ServiceBroker            bool   `yaml:"service_broker"`

	IconImage           string `yaml:"icon_image"`
	DeprecatedTileImage string `yaml:"deprecated_tile_image"`

	Cloud   string `yaml:"cloud"`
	Network string `yaml:"network"`

	Serial               bool                  `yaml:"serial"`
	InstallTimeVerifiers []InstallTimeVerifier `yaml:"install_time_verifiers"` // TODO: schema?

	BaseReleasesURL         string                  `yaml:"base_releases_url"`
	Variables               []Variable              `yaml:"variables"` // TODO: schema?
	Releases                []Release               `yaml:"releases"`
	StemcellCriteria        StemcellCriteria        `yaml:"stemcell_criteria"`
	PropertyBlueprints      PropertyBlueprints      `yaml:"property_blueprints"`
	FormTypes               []FormType              `yaml:"form_types"`
	JobTypes                []JobType               `yaml:"job_types"`
	RequiresProductVersions []ProductVersion        `yaml:"requires_product_versions"`
	PostDeployErrands       []ErrandTemplate        `yaml:"post_deploy_errands"`
	PreDeleteErrands        []ErrandTemplate        `yaml:"pre_delete_errands"`
	RuntimeConfigs          []RuntimeConfigTemplate `yaml:"runtime_configs"`
}

func Parse

func Parse(r io.Reader) (ProductTemplate, error)

func (*ProductTemplate) FindJobTypeWithName added in v0.85.0

func (productTemplate *ProductTemplate) FindJobTypeWithName(name string) (*JobType, int, error)

func (*ProductTemplate) FindPropertyBlueprintWithName added in v0.85.0

func (productTemplate *ProductTemplate) FindPropertyBlueprintWithName(name string) (PropertyBlueprint, int, error)

func (*ProductTemplate) HasJobTypeWithName added in v0.85.0

func (productTemplate *ProductTemplate) HasJobTypeWithName(name string) bool

func (*ProductTemplate) HasPostDeployErrandWithName added in v0.85.0

func (productTemplate *ProductTemplate) HasPostDeployErrandWithName(name string) bool

type ProductVersion

type ProductVersion struct {
	Name    string `yaml:"name"`
	Version string `yaml:"version"`
}

type PropertyBlueprint

type PropertyBlueprint interface {
	PropertyName() string
	PropertyType() string
	HasDefault() bool
	IsConfigurable() bool
	IsOptional() bool
}

type PropertyBlueprintOption

type PropertyBlueprintOption struct {
	Label string `yaml:"label"`
	Name  string `yaml:"name"`
}

type PropertyBlueprints

type PropertyBlueprints []PropertyBlueprint

func (*PropertyBlueprints) UnmarshalYAML

func (pb *PropertyBlueprints) UnmarshalYAML(list *yaml.Node) error

type PropertyInput

type PropertyInput interface {
	Ref() string
}

type PropertyInputs

type PropertyInputs []PropertyInput

func (*PropertyInputs) UnmarshalYAML

func (pi *PropertyInputs) UnmarshalYAML(list *yaml.Node) error

type Release

type Release struct {
	Name    string `yaml:"name"`
	Version string `yaml:"version"`
	File    string `yaml:"file"`

	SHA1       string `yaml:"sha1,omitempty"`        // NOTE: this only exists because of kiln
	CommitHash string `yaml:"commit_hash,omitempty"` // read from release.MF yaml commit_sha field

}

func (Release) Validate

func (r Release) Validate() error

type ResourceDefinition

type ResourceDefinition struct {
	Name         string `yaml:"name"`
	Default      int    `yaml:"default"`
	Configurable bool   `yaml:"configurable"`
	Constraints  any    `yaml:"constraints,omitempty"` // TODO: schema?

}

type RuntimeConfigTemplate

type RuntimeConfigTemplate struct {
	Name          string `yaml:"name"`
	RuntimeConfig string `yaml:"runtime_config"`
}

type SelectorOptionPropertyInput

type SelectorOptionPropertyInput struct {
	Reference string `yaml:"reference"`
	Label     string `yaml:"label"`

	PropertyInputs []SimplePropertyInput `yaml:"property_inputs,omitempty"`
}

type SelectorPropertyBlueprint

type SelectorPropertyBlueprint struct {
	SimplePropertyBlueprint `yaml:",inline"`

	OptionTemplates []SelectorPropertyOptionTemplate `yaml:"option_templates"`
}

type SelectorPropertyInput

type SelectorPropertyInput struct {
	SimplePropertyInput `yaml:",inline"`

	SelectorPropertyInputs []SelectorOptionPropertyInput `yaml:"selector_property_inputs,omitempty"`
}

type SelectorPropertyOptionTemplate

type SelectorPropertyOptionTemplate struct {
	Name               string                    `yaml:"name"`
	SelectValue        string                    `yaml:"select_value"`
	PropertyBlueprints []SimplePropertyBlueprint `yaml:"property_blueprints"`
	NamedManifests     []NamedManifest           `yaml:"named_manifests"`
}

type SimplePropertyBlueprint

type SimplePropertyBlueprint struct {
	Name           string                    `yaml:"name"`
	Type           string                    `yaml:"type"`
	Default        any                       `yaml:"default"`     // TODO: schema?
	Constraints    any                       `yaml:"constraints"` // TODO: schema?
	Options        []PropertyBlueprintOption `yaml:"options"`     // TODO: schema?
	Configurable   bool                      `yaml:"configurable"`
	Optional       bool                      `yaml:"optional"`
	FreezeOnDeploy bool                      `yaml:"freeze_on_deploy"`

	Unique bool `yaml:"unique"`

	ResourceDefinitions []ResourceDefinition `yaml:"resource_definitions"`
}

func (SimplePropertyBlueprint) HasDefault added in v0.85.0

func (blueprint SimplePropertyBlueprint) HasDefault() bool

func (SimplePropertyBlueprint) IsConfigurable added in v0.85.0

func (blueprint SimplePropertyBlueprint) IsConfigurable() bool

func (SimplePropertyBlueprint) IsOptional added in v0.87.0

func (blueprint SimplePropertyBlueprint) IsOptional() bool

func (SimplePropertyBlueprint) PropertyName added in v0.77.2

func (blueprint SimplePropertyBlueprint) PropertyName() string

func (SimplePropertyBlueprint) PropertyType added in v0.85.0

func (blueprint SimplePropertyBlueprint) PropertyType() string

type SimplePropertyInput

type SimplePropertyInput struct {
	Reference   string `yaml:"reference"`
	Label       string `yaml:"label"`
	Description string `yaml:"description,omitempty"`
	Placeholder string `yaml:"placeholder,omitempty"`
}

func (SimplePropertyInput) Ref added in v0.77.2

func (input SimplePropertyInput) Ref() string

type StemcellCriteria

type StemcellCriteria struct {
	OS                         string `yaml:"os"`
	Version                    string `yaml:"version"`
	EnablePatchSecurityUpdates bool   `yaml:"enable_patch_security_updates"`
}

type Template

type Template struct {
	Name     string `yaml:"name"`
	Release  string `yaml:"release"`
	Manifest string `yaml:"manifest,omitempty"`
	Consumes string `yaml:"consumes,omitempty"`
	Provides string `yaml:"provides,omitempty"`
}

type ValidationError

type ValidationError struct {
	Kind    any
	Message string
}

func NewValidationError

func NewValidationError(kind any, message string) ValidationError

func (ValidationError) Error

func (ve ValidationError) Error() string

type Variable

type Variable struct {
	Name    string `yaml:"name"`
	Options any    `yaml:"options,omitempty"` // TODO: schema?
	Type    string `yaml:"type"`
}

type VerifierBlueprint

type VerifierBlueprint struct {
	Name       string `yaml:"name"`
	Properties any    `yaml:"properties"` // TODO: schema?
}

type ZeroIfBinding

type ZeroIfBinding struct {
	PropertyReference string `yaml:"property_reference"`
	PropertyValue     string `yaml:"property_value"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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