jsonfield

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Description = "make a map[string]interface{} key to json field name"
View Source
var Flags = []cli.Flag{

	cli.StringFlag{
		Name:  "type,t",
		Usage: "the `TYPE` to map field",
	},
	cli.StringFlag{
		Name:  "name,n",
		Usage: "the `FUNCTION` to generate",
	},
	cli.StringFlag{
		Name:  "output,o",
		Usage: "the `FILE` to output",
	},
	cli.StringFlag{
		Name:  "tag,g",
		Usage: "tag name to define the key name",
	},
}
View Source
var Usage = "generate map to json field function"

Functions

func Action

func Action(c *cli.Context) error

Types

type Config

type Config struct {
	Type    string
	Name    string
	Output  string
	TagName string
}

type Generator

type Generator struct {
	generator.Generator
	Receiver   parser.Type
	ResultType parser.Type
	FuncType   parser.Type
	TagName    string
}

func NewGenerator

func NewGenerator() *Generator

func (*Generator) Generate

func (g *Generator) Generate(c *Config) error

func (*Generator) PrepareTask

func (g *Generator) PrepareTask(c *Config)

func (*Generator) Run

func (g *Generator) Run()

Jump to

Keyboard shortcuts

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