builder

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCRDs

func LoadCRDs(dirpath string) ([]*apiextensions.CustomResourceDefinition, error)

LoadCRDs loads all CustomResourceDefinition resources from a directory (glob)

Types

type FieldModel

type FieldModel struct {
	Name        string
	Type        string
	TypeKey     *string
	Description string
	Required    bool
	Schema      apiextensions.JSONSchemaProps
}

type GroupModel

type GroupModel struct {
	// Metadata PageMetadata `yaml:"metadata"`
	Group   string       `yaml:"group"`
	Version string       `yaml:"version"`
	Kinds   []*KindModel `yaml:"kinds"`
}

type KindModel

type KindModel struct {
	// Metadata PageMetadata `yaml:"metadata"`
	Name string `yaml:"name"`

	Types []*TypeModel
}

type Model

type Model struct {
	Metadata PageMetadata  `yaml:"metadata"`
	Groups   []*GroupModel `yaml:"groups"`
}

func LoadModel

func LoadModel(file string) (*Model, error)

LoadModel loads a Model from a TOC yaml

type ModelBuilder

type ModelBuilder struct {
	Model              *Model
	Strict             bool
	TemplatesDirOrFile string
	OutputFilepath     string
	// contains filtered or unexported fields
}

ModelBuilder is the entry point for docs generation

func NewModelBuilder

func NewModelBuilder(model *Model, strict bool, templatesDirOrFile string, outputFilepath string, builtinTemplates embed.FS) *ModelBuilder

func (*ModelBuilder) Add

Add adds a CustomResourceDefinition to the model

func (*ModelBuilder) Output

func (b *ModelBuilder) Output() error

Output writes markdown to the output direcory

type PageMetadata

type PageMetadata struct {
	Title       string `yaml:"title"`
	Weight      int    `yaml:"weight"`
	Description string `yaml:"description"`
}

type TypeModel

type TypeModel struct {
	Name        string
	Key         string
	ParentKey   *string
	Description string
	IsTopLevel  bool
	Fields      []*FieldModel
}

Jump to

Keyboard shortcuts

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