Documentation
¶
Index ¶
- func ExtractExtensionGVKs(extensions map[string]interface{}) []schema.GroupVersionKind
- func ExtractPathGVKs(path *spec3.Path) []schema.GroupVersionKind
- func FindFiles(args ...string) ([]string, error)
- func IsEmptyYamlDocument(document Document) bool
- func IsJson(file string) bool
- func IsYaml(file string) bool
- func IsYamlOrJson(file string) bool
- func VisitSchema(name string, s *spec.Schema, visitor SchemaVisitor) *spec.Schema
- type Document
- type PostorderVisitor
- type PreorderVisitor
- type SchemaVisitor
- type VisitingContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractExtensionGVKs ¶
func ExtractExtensionGVKs(extensions map[string]interface{}) []schema.GroupVersionKind
func ExtractPathGVKs ¶
func ExtractPathGVKs(path *spec3.Path) []schema.GroupVersionKind
func IsEmptyYamlDocument ¶
IsEmptyYamlDocument checks if a yaml document is empty (contains only comments)
Returns true for comment-only single documents, and strings with multiple documents where all docs are comment-only.
func IsYamlOrJson ¶
func VisitSchema ¶
Types ¶
type PostorderVisitor ¶
type PostorderVisitor func(ctx VisitingContext, s *spec.Schema) *spec.Schema
func (PostorderVisitor) VisitAfter ¶
func (f PostorderVisitor) VisitAfter(ctx VisitingContext, s **spec.Schema)
func (PostorderVisitor) VisitBefore ¶
func (f PostorderVisitor) VisitBefore(ctx VisitingContext, s **spec.Schema) bool
type PreorderVisitor ¶
There is no "left" or "right" on this tree, so no in-order is necessary
func (PreorderVisitor) VisitAfter ¶
func (f PreorderVisitor) VisitAfter(ctx VisitingContext, s **spec.Schema)
func (PreorderVisitor) VisitBefore ¶
func (f PreorderVisitor) VisitBefore(ctx VisitingContext, s **spec.Schema) bool
type SchemaVisitor ¶
type SchemaVisitor interface { // Called on a node before its children. // Return false to stop exploring this subtree, otherwise return true. VisitBefore(ctx VisitingContext, s **spec.Schema) bool // Called on a node after its children. VisitAfter(ctx VisitingContext, s **spec.Schema) }
type VisitingContext ¶
type VisitingContext struct { // What field of the parent context was traversed to find the current // schema SchemaField string // If ShemaField is a collection, what key is this schema contained within // SchemaField Key string // If ShemaField is a collection, what index is this schema contained within // SchemaField // // Part of a Union with `key` If one is set, the other must be unset Index int Parent *VisitingContext }
func (*VisitingContext) WithSubField ¶
func (v *VisitingContext) WithSubField(field, key string) VisitingContext
func (*VisitingContext) WithSubIndex ¶
func (v *VisitingContext) WithSubIndex(field string, idx int) VisitingContext
Click to show internal directories.
Click to hide internal directories.