package
module
Version:
v0.0.0-...-45d8dff
Opens a new window with list of versions in this module.
Published: Jan 5, 2020
License: MIT
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
README
¶
struct2json
Dump a Go struct definition as JSON
Documentation
¶
type Document struct {
Structs []Struct `json:"structs"`
}
Document contains a series of Structs
GetStructs parses a single .go file, finding all declared/named structs.
Append adds other structs to this Document
Get returns the Struct with the given name. The bool value indicates if the
given name was found or not.
WriteJSON outputs a Document as JSON.
type Field struct {
Name string `json:"name"`
Type string `json:"type"`
Tags map[string]string `json:"tags,omitempty"`
}
Field contains a name, a type, and possibly some Tags
type Struct struct {
Name string `json:"name"`
Fields []Field `json:"fields"`
}
Struct contains a name, and a series of Fields
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.