Skip to content

ametsuramet/gin_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GIN GENERATOR

INSTALL PACKAGE:

go get -u github.com/ametsuramet/gin_generator

Example: Create file ex: generator.go

package main

import (
	// "fmt"
	"github.com/ametsuramet/gin_generator"
	"path/filepath"
)

func main() {
	jsonFile, _ := filepath.Abs("builder.json")
	path, _ := filepath.Abs("")
	gen := gin_generator.Set(jsonFile, path, nil)

	gen.Generate()
}

Create file json: generator.go

[
	{
		"name": "AboutUs",
		"schema": [
			{
				"field": "banner",
				"type": "string"
			},
			{
				"field": "image",
				"type": "string"
			},
			{
				"field": "who_we_are_image",
				"type": "string"
			},
			{
				"field": "active_flag",
				"type": "boolean"
			},
			{
				"field": "created_by",
				"type": "integer::unsigned"
			},
			{
				"field": "updated_by",
				"type": "integer::unsigned"
			}
		]
	}
]

RUN:

go run generator.go

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages