doccompiler

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeOk int = iota
	ExitCodeFailedReadParams
	ExitCodeFailedHandleAction
	ExitCodeFailedConfigFields
	ExitCodeFailedHandleConfig
	ExitCodeFailedWriteResult
	ExitCodeFailedReadGroups
	ExitCodeFailedHandleGroups
	ExitCodeFailedReadTemplate
	ExitCodeFailedParseTemplate
	ExitCodeFailedExecuteTemplate
	ExitCodeFailedCreateExtra
	ExitCodeFailedSyntaxError
	ExitCodeFailedNoDataRoot
	ExitCodeFailedListDir
)

ExitCodes

View Source
const TemplateStr = `` /* 2283-byte string literal not displayed */

TemplateStr used to generate in memory documentation golang package

Variables

View Source
var FuncMap = template.FuncMap{
	"params": SortedParamsKeys,
	"join":   strings.Join,
}
View Source
var UseFolderStructure = false

Functions

func CreateDocEntry

func CreateDocEntry(dataRoot string, subFolders ...string) (common.DocEntry, error)

CreateDocEntry create DocEntry using files in sub folder

func FileExists

func FileExists(filename string) (bool, error)

FileExists check if file exists

func GetMarkDownFile

func GetMarkDownFile(dataRoot string, subFolders []string, file string) (string, error)

GetMarkDownFile read markdown file into memory and do necessary escaping

func ReadAndUnmarshal

func ReadAndUnmarshal(filename string, output interface{}) error

ReadAndUnmarshal file to object

func SortedParamsKeys

func SortedParamsKeys(paramsMap map[string][]string) []string

SortedParamsKeys returns map keys as a sorted slice

Types

type DocCompiler

type DocCompiler interface {
	// Compile documentation to golang represented as bytes
	Compile() []byte
	// CompileToFile compiles the data to file
	CompileToFile(file string)
	// Add documentation data from directory
	AddDataFromDir(dir string)
	// Add documentation data from variables in generated code
	AddDataFromGenerated(actions, schedulers, config, extra map[string]common.DocEntry, params map[string][]string, groups []common.GroupsEntry)
}

func New

func New() DocCompiler

Jump to

Keyboard shortcuts

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