Documentation
¶
Index ¶
- type Field
- type File
- type OutputFile
- type Registry
- func (reg *Registry) GetOutputPath() string
- func (reg *Registry) GetWriter() io.Writer
- func (reg *Registry) Load() ([]*File, error)
- func (reg *Registry) SetFile(filename string)
- func (reg *Registry) SetFiles(f []string)
- func (reg *Registry) SetFilesInDir(path string) error
- func (reg *Registry) SetInputDirPath(path string)
- func (reg *Registry) SetOutputPath(path string)
- func (reg *Registry) SetPackageName(pkg string)
- func (reg *Registry) SetWriter(w io.Writer)
- func (reg *Registry) SetupInput(dirOrFilePath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct { // Name is Field Name. Name string // Kind id Field data type. Kind reflect.Kind // Fields is child Fields. Fields []*Field }
Field is Field in json.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a registry of information.
func (*Registry) GetOutputPath ¶
GetOutputPath set package name of generated models.
func (*Registry) Load ¶
Load walks through all files having suffix ".json" in the directory specified by path and returns a list of descriptor.File.
func (*Registry) SetFile ¶
SetFile set input file path to Registry. This method also extract input dir path which is prefix of path to the file.
func (*Registry) SetFilesInDir ¶
SetFilesInDir walks through files in inputDirPath and add JSON file to files list.
func (*Registry) SetInputDirPath ¶
SetInputDirPath set input dir path to Registry.
func (*Registry) SetOutputPath ¶
SetOutputPath set package name of generated models.
func (*Registry) SetPackageName ¶
SetPackageName set package name of generated models.
func (*Registry) SetupInput ¶
SetupInput verify path of input and handle based on if it's file path or dir path.