gin

package
v0.0.0-...-2aa56cf Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const RouterTpl = `` /* 2526-byte string literal not displayed */

Variables

Functions

func NewGinGenerator

func NewGinGenerator(t *types.Type, name string, outputPkg string) generator.Generator

func Packages

func Packages(ctx *generator.Context, arguments *args.GeneratorArgs) generator.Packages

func ToFirstLowerString

func ToFirstLowerString(str string) string

func ToFirstUpperString

func ToFirstUpperString(str string) string

Types

type Action

type Action struct {
	Method HttpMethod `json:"method"`
	Param  string     `json:"param"`
	Result string     `json:"result"`
}

type GinGenerator

type GinGenerator struct {
	generator.DefaultGen
	// contains filtered or unexported fields
}

func (*GinGenerator) Filter

func (g *GinGenerator) Filter(c *generator.Context, t *types.Type) bool

func (*GinGenerator) GenerateType

func (g *GinGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error

func (*GinGenerator) Namers

type HttpMethod

type HttpMethod web.HttpMethod

func (HttpMethod) CamelString

func (h HttpMethod) CamelString() string

func (HttpMethod) LowerString

func (h HttpMethod) LowerString() string

type Resource

type Resource struct {
	Name    string    `json:"name"`
	Path    string    `json:"path"`
	Actions []*Action `json:"actions"`
}

type RestRouteGenerator

type RestRouteGenerator struct {
	Route *Route
	// contains filtered or unexported fields
}

func NewRestRouteGenerator

func NewRestRouteGenerator(r *Route) *RestRouteGenerator

func (*RestRouteGenerator) Generate

func (r *RestRouteGenerator) Generate() string

type Route

type Route struct {
	Package   string      `json:"package"`
	Resources []*Resource `json:"resources"`
}

Jump to

Keyboard shortcuts

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