structdoc

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(s interface{}) interface{}

Generate constructs a documentation interface from the provided struct by using the struct field types as well as the information given in the "doc" struct tag. In the doc tag the following information can be given in a comma-separated list:

  • msg: describing message
  • default: default value
  • req: required field
  • option,o: 1 possible value (multiple values are specified by multiple occurrences)

e.g.: `doc:"msg=this is my message,default=0,o=0, o=1, req"`. If no "doc" tag is present the field will be ignored. The output format is map[string]interface{}, where the interface is either a doc-string or a substructure of the same format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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