docgen

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrefixedValue

func GetPrefixedValue(origin, expression string) string

Types

type Doc

type Doc struct {
	Item        DocItem
	DisplayName string
	Content     string
	Version     string
	Url         string
	Desc        string
	Status      string

	RootNode *ast.File
	Logger   logr.Logger
}

func GetDocumentParser

func GetDocumentParser(source DocItem, log logr.Logger) *Doc

func NewDoc

func NewDoc(item DocItem, log logr.Logger) *Doc

func (*Doc) Append

func (d *Doc) Append(line string)

func (*Doc) Generate

func (d *Doc) Generate() error

type DocIndex

type DocIndex struct {
	Path string
}

type DocItem

type DocItem struct {
	Name                         string
	SourcePath                   string
	DestPath                     string
	Category                     string
	DefaultValueFromTagExtractor func(string) string
}

type DocItems

type DocItems []DocItem

type FieldSorter added in v0.33.0

type FieldSorter []*ast.Field

func (FieldSorter) Len added in v0.33.0

func (s FieldSorter) Len() int

func (FieldSorter) Less added in v0.33.0

func (s FieldSorter) Less(i, j int) bool

func (FieldSorter) Swap added in v0.33.0

func (s FieldSorter) Swap(i, j int)

type SourceDir

type SourceDir struct {
	Path     string
	DestPath string
}

type SourceLister

type SourceLister struct {
	Logger                       logr.Logger
	Sources                      map[string]SourceDir
	IgnoredSources               []string
	IncludeSources               []string
	DefaultValueFromTagExtractor func(string) string
	Index                        *Doc
	DocGeneratedHook             func(doc *Doc) error
	Header                       string
	Footer                       string
}

func NewSourceLister

func NewSourceLister(sources map[string]SourceDir, logger logr.Logger) *SourceLister

func (*SourceLister) Generate

func (lister *SourceLister) Generate() error

func (*SourceLister) ListSources

func (sl *SourceLister) ListSources() ([]DocItem, error)

Jump to

Keyboard shortcuts

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