func BoolForScalarNode(node *yaml.Node) (bool, bool)
BoolForScalarNode returns the bool value of a node.
func CallExtension(context *Context, in *yaml.Node, extensionName string) (handled bool, response *anypb.Any, err error)
CallExtension calls a binary extension handler.
func ClearCaches()
ClearCaches clears all caches.
func ClearFileCache()
ClearFileCache clears the file cache.
func ClearInfoCache()
ClearInfoCache clears the info cache.
func ConvertInterfaceArrayToStringArray(interfaceArray []interface{}) []string
ConvertInterfaceArrayToStringArray converts an array of interfaces to an array of strings, if possible.
func Description(item interface{}) string
Description returns a human-readable represention of an item.
func DisableFileCache()
DisableFileCache turns off file caching.
func DisableInfoCache()
DisableInfoCache turns off parsed info caching.
func Display(node *yaml.Node) string
Display returns a description of a node for use in error messages.
func EnableFileCache()
EnableFileCache turns on file caching.
func EnableInfoCache()
EnableInfoCache turns on parsed info caching.
func FetchFile(fileurl string) ([]byte, error)
FetchFile gets a specified file from the local filesystem or a remote location.
func FloatForScalarNode(node *yaml.Node) (float64, bool)
FloatForScalarNode returns the float value of a node.
func GetInfoCache() map[string]*yaml.Node
GetInfoCache returns the info cache map.
func IntForScalarNode(node *yaml.Node) (int64, bool)
IntForScalarNode returns the integer value of a node.
func InvalidKeysInMap(m *yaml.Node, allowedKeys []string, allowedPatterns []*regexp.Regexp) []string
InvalidKeysInMap returns keys in a map that don't match a list of allowed keys and patterns.
func MapHasKey(m *yaml.Node, key string) bool
MapHasKey returns true if a yamlv2.MapSlice contains a specified key.
func MapValueForKey(m *yaml.Node, key string) *yaml.Node
MapValueForKey gets the value of a map value for a specified key.
func Marshal(in *yaml.Node) []byte
Marshal creates a yaml version of a structure in our preferred style
func MissingKeysInMap(m *yaml.Node, requiredKeys []string) []string
MissingKeysInMap identifies which keys from a list of required keys are not in a map.
func NewErrorGroupOrNil(errors []error) error
NewErrorGroupOrNil returns a new ErrorGroup for a slice of errors or nil if the slice is empty.
func NewMappingNode() *yaml.Node
NewMappingNode creates a new Mapping node.
func NewNullNode() *yaml.Node
NewNullNode creates a new Null node.
func NewScalarNodeForBool(b bool) *yaml.Node
NewScalarNodeForBool creates a new node to hold a bool.
func NewScalarNodeForFloat(f float64) *yaml.Node
NewScalarNodeForFloat creates a new node to hold a float.
func NewScalarNodeForInt(i int64) *yaml.Node
NewScalarNodeForInt creates a new node to hold an integer.
func NewScalarNodeForString(s string) *yaml.Node
NewScalarNodeForString creates a new node to hold a string.
func NewSequenceNode() *yaml.Node
NewSequenceNode creates a new Sequence node.
func NewSequenceNodeForStringArray(strings []string) *yaml.Node
NewSequenceNodeForStringArray creates a new node to hold an array of strings.
func PluralProperties(count int) string
PluralProperties returns the string "properties" pluralized.
func ReadBytesForFile(filename string) ([]byte, error)
ReadBytesForFile reads the bytes of a file.
func ReadInfoForRef(basefile string, ref string) (*yaml.Node, error)
ReadInfoForRef reads a file and return the fragment needed to resolve a $ref.
func ReadInfoFromBytes(filename string, bytes []byte) (*yaml.Node, error)
ReadInfoFromBytes unmarshals a file as a *yaml.Node.
func RemoveFromFileCache(fileurl string)
RemoveFromFileCache removes an entry from the file cache.
func RemoveFromInfoCache(filename string)
RemoveFromInfoCache removes an entry from the info cache.
func SequenceNodeForNode(node *yaml.Node) (*yaml.Node, bool)
SequenceNodeForNode returns a node if it is a SequenceNode.
func SortedKeysForMap(m *yaml.Node) []string
SortedKeysForMap returns the sorted keys of a yamlv2.MapSlice.
func StringArrayContainsValue(array []string, value string) bool
StringArrayContainsValue returns true if a string array contains a specified value.
func StringArrayContainsValues(array []string, values []string) bool
StringArrayContainsValues returns true if a string array contains all of a list of specified values.
func StringArrayForSequenceNode(node *yaml.Node) []string
StringArrayForSequenceNode converts a sequence node to an array of strings, if possible.
func StringForScalarNode(node *yaml.Node) (string, bool)
StringForScalarNode returns the string value of a node.
func StringValue(item interface{}) (value string, ok bool)
StringValue returns the string value of an item.
func UnpackMap(in *yaml.Node) (*yaml.Node, bool)
UnpackMap gets a *yaml.Node if possible.
Context contains state of the compiler as it traverses a document.
type Context struct { Parent *Context Name string Node *yaml.Node ExtensionHandlers *[]ExtensionHandler }
func NewContext(name string, node *yaml.Node, parent *Context) *Context
NewContext returns a new object representing the compiler state
func NewContextWithExtensions(name string, node *yaml.Node, parent *Context, extensionHandlers *[]ExtensionHandler) *Context
NewContextWithExtensions returns a new object representing the compiler state
func (context *Context) Description() string
Description returns a text description of the compiler state
Error represents compiler errors and their location in the document.
type Error struct { Context *Context Message string }
func NewError(context *Context, message string) *Error
NewError creates an Error.
func (err *Error) Error() string
Error returns the string value of an Error.
ErrorGroup is a container for groups of Error values.
type ErrorGroup struct { Errors []error }
func (group *ErrorGroup) Error() string
ExtensionHandler describes a binary that is called by the compiler to handle specification extensions.
type ExtensionHandler struct { Name string }