fieldmeta

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// String defines a string flag
	String FieldValueType = "string"
	// Bool defines a bool flag
	Bool = "bool"
	// Float defines a float flag
	Float = "float"
	// Int defines an int flag
	Int = "int"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldMeta

type FieldMeta struct {
	// Substitutions are substitutions that may be performed against this field
	Substitutions []Substitution `yaml:"substitutions,omitempty" json:"substitutions,omitempty"`
	// OwnedBy records the owner of this field
	OwnedBy string `yaml:"ownedBy,omitempty" json:"ownedBy,omitempty"`
	// DefaultedBy records that this field was default, but may be changed by other owners
	DefaultedBy string `yaml:"defaultedBy,omitempty" json:"defaultedBy,omitempty"`
	// Description is a description of the current field value, e.g. why it was set
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	// Type is the type of the field value
	Type FieldValueType `yaml:"type,omitempty" json:"type,omitempty"`
}

FieldMeta contains metadata that may be attached to fields as comments

func (*FieldMeta) Read

func (fm *FieldMeta) Read(n *yaml.RNode) error

Read reads the FieldMeta from a node

func (*FieldMeta) Write

func (fm *FieldMeta) Write(n *yaml.RNode) error

Write writes the FieldMeta to a node

type FieldValueType

type FieldValueType string

FieldValueType defines the type of input to register

func (FieldValueType) String

func (it FieldValueType) String() string

func (FieldValueType) Tag

func (it FieldValueType) Tag() string

func (FieldValueType) TagForValue

func (it FieldValueType) TagForValue(value string) string

func (FieldValueType) Validate

func (it FieldValueType) Validate(value string) error

type Substitution

type Substitution struct {
	// Name is the name of the substitution and read by tools
	Name string `yaml:"name,omitempty" json:"name,omitempty"`
	// Marker is the marker used for replacement
	Marker string `yaml:"marker,omitempty" json:"marker,omitempty"`
	// Value is the current value that has been substituted for the Marker
	Value string `yaml:"value,omitempty" json:"value,omitempty"`
}

Substitution defines a substitution that may be performed against the field

Jump to

Keyboard shortcuts

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