pkg

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootRequiredFields = []string{"apiVersion", "kind", "spec", "metadata"}

Functions

func Generate

func Generate(crd *v1beta1.CustomResourceDefinition, w io.WriteCloser, enableComments, minimal bool) (err error)

Generate takes a CRD content and path, and outputs.

func LoadTemplates added in v0.4.0

func LoadTemplates() error

LoadTemplates creates a map of loaded templates that are primed and ready to be rendered.

func RenderContent added in v0.4.0

func RenderContent(w io.WriteCloser, crd *v1beta1.CustomResourceDefinition, comments, minimal bool) (err error)

RenderContent creates an HTML website from the CRD content.

Types

type Parser added in v0.5.0

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser added in v0.5.0

func NewParser(group, kind string, comments, requiredOnly bool) *Parser

NewParser creates a new parser contains most of the things that do not change over each call.

func (*Parser) ParseProperties added in v0.5.0

func (p *Parser) ParseProperties(version string, file io.Writer, properties map[string]v1beta1.JSONSchemaProps, requiredFields []string) error

ParseProperties takes a writer and puts out any information / properties it encounters during the runs. It will recursively parse every "properties:" and "additionalProperties:". Using the types, it will also output some sample data based on those types.

type Property

type Property struct {
	Name        string
	Description string
	Type        string
	Nullable    bool
	Patterns    string
	Format      string
	Indent      int
	Version     string
	Default     string
	Required    bool
	Properties  []*Property
}

Property builds up a Tree structure of embedded things.

type Version

type Version struct {
	Version     string
	Kind        string
	Group       string
	Properties  []*Property
	Description string
	YAML        string
}

Version wraps a top level version resource which contains the underlying openAPIV3Schema.

type ViewPage

type ViewPage struct {
	Versions []Version
}

ViewPage is the template for view.html.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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