output

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WritePage

func WritePage(crd *apiextensionsv1.CustomResourceDefinition,
	annotations []CRDAnnotationSupport,
	owners []string,
	topics []string,
	providers []string,
	crFolder,
	outputFolder,
	repoURL,
	repoRef,
	templatePath string) error

WritePage creates a CRD schema documentation Markdown page.

Types

type CRDAnnotationSupport

type CRDAnnotationSupport struct {
	Annotation    string
	APIVersion    string
	CRDName       string
	Release       string
	Documentation string
}

CRDAnnotationSupport represents the release and

type PageData

type PageData struct {
	Description         string
	Group               string
	NamePlural          string
	NameSingular        string
	Owners              []string
	Topics              []string
	Providers           []string
	Scope               string
	SourceRepository    string
	SourceRepositoryRef string
	Title               string
	Weight              int
	// Version names.
	Versions []string
	// Schema per version.
	VersionSchemas map[string]SchemaVersion
}

PageData is all the data we pass to the HTML template for the CRD detail page.

type SchemaProperty

type SchemaProperty struct {
	// The depth of the item in the JSONPath hierarchy
	Depth int8
	// Path is the full JSONpath path of the attribute, e. g. ".spec.version".
	Path string
	// Name is the attribute name.
	Name string
	// Type is the textual representaiton of the type ("object", "array", "number", "string", "boolean").
	Type string
	// Description is a user-friendly description of the attribute.
	Description string
	// Required specifies whether the property is required.
	Required bool
}

SchemaProperty is a simplistic, flattened representation of a property in a JSON Schema, without the recursion and containing only the elements we intend to expose in our output.

type SchemaVersion

type SchemaVersion struct {
	Version    string
	Properties []SchemaProperty
	// YAML string showing an example CR.
	ExampleCR   string
	Annotations []CRDAnnotationSupport
}

SchemaVersion is the schema information for a specific CRD version we want to expose to our template.

Jump to

Keyboard shortcuts

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