http

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IMPLEMENT = []byte(`package http
import (
	"github.com/gin-gonic/gin"
    cx "github.com/codingXiang/cxgateway/delivery"
)

type {{ .module }}HttpHandler struct {
	gateway cx.HttpHandler
	svc     {{ .package }}.Service
}

func New{{ .module }}HttpHandler(gateway cx.HttpHandler, svc {{ .package }}.Service) delivery.HttpHandler {
	var handler = &{{ .module }}HttpHandler{
		gateway: gateway,
		svc:     {{ .package }}.Service,
	}
	/*
		v1 版本的 {{ .module }} API
	  */
	v1 := gateway.GetApiRoute().Group("/v1/{{ .package }}")
{{ .api.method }}
	return handler
}

{{ .implement }}
`)
	API_METHOD = []byte(`	v1.{{ .http.method }}("{{ .api.path }}", e.Wrapper(handler.{{ .method }}))`)
	METHOD     = []byte(`func (g *{{ .module }}HttpHandler) {{ .method }}(c *gin.Context) error {
	panic("implement me")
}`)
)
View Source
var (
	INTERFACE_ABSTRACT_METHOD = []byte(`	{{ .method }}(c *gin.Context) error`)
)

Interface

Functions

func GetApiPath

func GetApiPath(in string) string

func GetHttpMethodName

func GetHttpMethodName(in string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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