junet

package module
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 0 Imported by: 0

README

JuNet

An composition framework. It contains gin, zap, jwt-go, viper

And, out of box to use.

Get Started

install cli
## for go1.16+, we use embed feature
go install github.com/Xwudao/junet/cmd/junet@latest
init project
junet init demo -m github.com/Xwudao/my-new-demo
  • project name: demo
  • go module name: github.com/Xwudao/my-new-demo

more

1、generate an new route

// in `pkg/routes/v1/gen.go`
//go:generate junet gen route -n Home

2、generate new db helper (gorm enhance)

//go:generate junet gen db

// the "gen:qs" is required, which tell junet cli generate funcs for `User`
//gen:qs
type User struct {
	ID       int64  `gorm:"column:id;primaryKey;AUTO_INCREMENT"`
	Username string `gorm:"column:username"`
	Email    string `gorm:"column:email"`
}

//this function original author: https://github.com/jirfag/go-queryset

//junet modify it to support gorm v2, and combine with junet cli

Documentation

Index

Constants

View Source
const (
	Debug   = "debug"
	Release = "release"
)
View Source
const (
	SuccessRtn = "success"
)

Variables

View Source
var Mode = Debug

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
Code generated by confx-gen.
Code generated by confx-gen.
gen
internal
Code generated by log-gen.
Code generated by log-gen.
gen

Jump to

Keyboard shortcuts

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