proofing

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidatePresence

func ValidatePresence(err error, v interface{}, 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"`
}

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 interface{} `yaml:"properties"` // TODO: schema?
}

type InstanceDefinition

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

}

type JobType

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

	Manifest    string      `yaml:"manifest"`
	MaxInFlight interface{} `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 NormalizedPropertyBlueprint

type NormalizedPropertyBlueprint struct {
	Property     string
	Configurable bool
	Default      interface{}
	Required     bool
	Type         string
}

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) AllPropertyBlueprints

func (pt ProductTemplate) AllPropertyBlueprints() []NormalizedPropertyBlueprint

type ProductVersion

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

type PropertyBlueprint

type PropertyBlueprint interface {
	Normalize(prefix string) []NormalizedPropertyBlueprint
}

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(unmarshal func(v interface{}) error) error

type PropertyInput

type PropertyInput interface{}

type PropertyInputs

type PropertyInputs []PropertyInput

func (*PropertyInputs) UnmarshalYAML

func (pi *PropertyInputs) UnmarshalYAML(unmarshal func(v interface{}) error) error

type Release

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

	SHA1 string `yaml:"sha1"` // NOTE: this only exists because of kiln

}

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  interface{} `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"`
}

func (SelectorPropertyBlueprint) Normalize

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        interface{}               `yaml:"default"`     // TODO: schema?
	Constraints    interface{}               `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) Normalize

type SimplePropertyInput

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

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    interface{}
	Message string
}

func NewValidationError

func NewValidationError(kind interface{}, message string) ValidationError

func (ValidationError) Error

func (ve ValidationError) Error() string

type Variable

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

type VerifierBlueprint

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

type ZeroIfBinding

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

Jump to

Keyboard shortcuts

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