Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDocEntry(dataRoot string, subFolders ...string) (common.DocEntry, error)
- func FileExists(filename string) (bool, error)
- func GetMarkDownFile(dataRoot string, subFolders []string, file string) (string, error)
- func ReadAndUnmarshal(filename string, output interface{}) error
- func SortedParamsKeys(paramsMap map[string][]string) []string
- type DocCompiler
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 ¶
CreateDocEntry create DocEntry using files in sub folder
func GetMarkDownFile ¶
GetMarkDownFile read markdown file into memory and do necessary escaping
func ReadAndUnmarshal ¶
ReadAndUnmarshal file to object
func SortedParamsKeys ¶
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
Click to show internal directories.
Click to hide internal directories.