config

package
v0.0.0-...-c4965f0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGV

func GetGV(group kubernetes.APIGroup, version kubernetes.APIVersion) string

GetGV returns the group/version for a resource and version (used for apiVersion:)

Types

type Categories

type Categories []Category

Categories is the list of fields categories for all definitions

func LoadCategories

func LoadCategories(filenames []string) (Categories, error)

LoadCategories from a configuration file

func (Categories) Find

func (o Categories) Find(key kubernetes.Key) []FieldCategory

type Category

type Category struct {
	Definition      kubernetes.Key  `yaml:"definition"`
	FieldCategories []FieldCategory `yaml:"field_categories"`
}

Category is the list of fields categories for a specific definition

type Chapter

type Chapter struct {
	Name             string                 `yaml:"name"`
	Group            *kubernetes.APIGroup   `yaml:"group"`
	Version          *kubernetes.APIVersion `yaml:"version"`
	Key              kubernetes.Key         `yaml:"key"`
	OtherDefinitions []string               `yaml:"otherDefinitions"`
	Sections         []*Section
}

Chapter contains a definition of a main resource and its associated resources and definitions

type FieldCategory

type FieldCategory struct {
	Name   string   `yaml:"name"`
	Fields []string `yaml:"fields"`
}

FieldCategory is a list of fields regrouped in the same category

type Part

type Part struct {
	Name     string     `yaml:"name"`
	Chapters []*Chapter `yaml:"chapters"`
}

Part contains chapters

type Section

type Section struct {
	Name       string
	Group      *kubernetes.APIGroup
	Version    *kubernetes.APIVersion
	Definition spec.Schema
	Key        *kubernetes.Key
}

Section contains a definition of a Kind for a given Group/Version

func NewSection

func NewSection(name string, definition *spec.Schema, group *kubernetes.APIGroup, version *kubernetes.APIVersion) *Section

NewSection returns a Section

func NewSectionForDefinition

func NewSectionForDefinition(name string, definition *spec.Schema, key kubernetes.Key) *Section

NewSectionForDefinition returns a Section for a definition

type TOC

type TOC struct {
	Parts                 []*Part              `yaml:"parts"`
	SkippedResources      []kubernetes.APIKind `yaml:"skippedResources"`
	Definitions           *spec.Definitions
	LinkEnds              kubernetes.LinkEnds
	DocumentedDefinitions map[kubernetes.Key][]string
	Actions               kubernetes.Actions
	Categories            Categories
}

TOC is the table of contents of the documentation

func LoadTOC

func LoadTOC(filename string) (*TOC, error)

LoadTOC loads a config file containing the TOC definition

func (*TOC) AddOtherResources

func (o *TOC) AddOtherResources(spec *kubernetes.Spec)

AddOtherResources adds not documented and not replaced resources to a new Part

func (*TOC) OutputChapter

func (o *TOC) OutputChapter(i int, chapter *Chapter, outputPart outputs.Part) error

OutputChapter outputs a chapter of the part

func (*TOC) OutputCommonParameters

func (o *TOC) OutputCommonParameters(i int, output outputs.Output) error

OutputCommonParameters outputs the parameters in common

func (*TOC) OutputDocument

func (o *TOC) OutputDocument(output outputs.Output) error

OutputDocument outputs contents using output

func (*TOC) OutputDocumentedDefinitions

func (o *TOC) OutputDocumentedDefinitions()

OutputDocumentedDefinitions outputs the list of definitions and on which properties they are defined

func (*TOC) OutputOperation

func (o *TOC) OutputOperation(i int, outputSection outputs.Section, operation *kubernetes.ActionInfo) error

OutputOperation outputs details of an Operation

func (*TOC) OutputOperations

func (o *TOC) OutputOperations(i int, outputChapter outputs.Chapter, operations *kubernetes.ActionInfoList) error

OutputOperations outputs the Operations chapter

func (*TOC) OutputPart

func (o *TOC) OutputPart(i int, part *Part, output outputs.Output) error

OutputPart outputs a Part

func (*TOC) OutputProperties

func (o *TOC) OutputProperties(defname string, definition spec.Schema, outputSection outputs.Section, prefix []string, group *kubernetes.APIGroup, version *kubernetes.APIVersion, key *kubernetes.Key) error

OutputProperties outputs the properties of a definition

func (*TOC) OutputSection

func (o *TOC) OutputSection(i int, section *Section, outputChapter outputs.Chapter) error

OutputSection outputs a section of the chapter

func (*TOC) PopulateAssociates

func (o *TOC) PopulateAssociates(thespec *kubernetes.Spec) error

PopulateAssociates adds sections to the chapters found in the spec

func (*TOC) ToKWebsite

func (o *TOC) ToKWebsite(outputDir string, templatesDir string) error

ToKWebsite outputs documentation in Markdown format for k/website in dir directory

func (*TOC) ToMarkdown

func (o *TOC) ToMarkdown(w io.Writer)

ToMarkdown writes a Markdown representation of the TOC

Jump to

Keyboard shortcuts

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