config

package
v0.0.0-...-8ef259b Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: Apache-2.0 Imports: 12 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 Chapter

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

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

type LinkEnds

type LinkEnds map[kubernetes.Key][]string

LinkEnds maps definition key to a link-end

func (LinkEnds) Add

func (o LinkEnds) Add(key kubernetes.Key, linkend []string)

Add a new map between key and linkend

func (LinkEnds) Debug

func (o LinkEnds) Debug()

type Part

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

Part contains chapters

type Section

type Section struct {
	Name       string
	APIVersion *string
	Definition spec.Schema
}

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

func NewSection

func NewSection(name string, definition *spec.Schema, apiVersion *string) *Section

NewSection returns a Section

type TOC

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

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) 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) 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, apiVersion *string) 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) ToDocbook

func (o *TOC) ToDocbook(w io.Writer) error

ToDocbook outputs documentation in Docbook format

func (*TOC) ToHugo

func (o *TOC) ToHugo(dir string) error

ToHugo outputs documentation in Markdown format for Hugo 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