kk_http

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

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateApi

func GenerateApi(apiModel ApiModel)

func GenerateDartApi

func GenerateDartApi(apiModel ApiModel)

func KKGin

func KKGin(stage *kk_stage.Stage) *gin.Engine

func ReadProtoBuf

func ReadProtoBuf(stage *kk_stage.Stage, ptr proto.Message) error

func RequestForm2Map

func RequestForm2Map(stage *kk_stage.Stage) (queryParameters map[string]string, err error)

func RequestParams2Map

func RequestParams2Map(stage *kk_stage.Stage) (queryParams map[string]string, err error)

RequestParams2Map 解析Get请求的data 返回参数map

func ResponseErrPB

func ResponseErrPB(stage *kk_stage.Stage, err error)

func ResponseFailPB

func ResponseFailPB(stage *kk_stage.Stage, res *kk_pb_type.PBResponse, data proto.Message)

func ResponseProtoBuf

func ResponseProtoBuf(c *gin.Context, obj any)

func ResponseSuccessPB

func ResponseSuccessPB(stage *kk_stage.Stage, res *kk_pb_type.PBResponse, data proto.Message)

func ServerWithGracefulShutdown

func ServerWithGracefulShutdown(stage *kk_stage.Stage, httpHandler http.Handler, serverAddr string)

func Success

Types

type ApiModel

type ApiModel struct {
	ApiPkgName      string
	GroupFuncName   string
	HandlerName     string
	HandlerFuncName string
	PreUrl          string //for fe api
}

Jump to

Keyboard shortcuts

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