genmodel

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldsProvider

type FieldsProvider interface {
	Fields() []field.Field
}

type Model

type Model struct {
	PackageName   string
	SchemaImport  string
	SchemaPackage string
	SchemaFile    string
	Name          string
	Fields        []*field.Descriptor
	SchemaConfig  *schemagen.SchemaConfig

	WriteModelToDir string
}

func (*Model) GenerateModel

func (m *Model) GenerateModel(fp FieldsProvider) (string, error)

GenerateModel generates golang file with model.

Returns output filepath and error.

func (*Model) GenerateValidators

func (m *Model) GenerateValidators(fp FieldsProvider) (string, error)

GenerateValidators generates golang file with model.

Returns output filepath and error.

Jump to

Keyboard shortcuts

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