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
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.
Click to show internal directories.
Click to hide internal directories.