web

package
v0.0.0-...-23b3bcd Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRestHandler

func NewRestHandler(o IController) app.HandlerFunc

func RestAccessLog

func RestAccessLog() app.HandlerFunc

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func (*Controller) Execute

func (obj *Controller) Execute()

func (*Controller) Finish

func (obj *Controller) Finish()

func (*Controller) GetContext

func (obj *Controller) GetContext() context.Context

func (*Controller) GetHttpStatus

func (obj *Controller) GetHttpStatus() int

func (*Controller) GetRequestCtx

func (obj *Controller) GetRequestCtx() *app.RequestContext

func (*Controller) GetResp

func (obj *Controller) GetResp() *RestResponse

func (*Controller) Prepare

func (obj *Controller) Prepare(c context.Context, ctx *app.RequestContext, para interface{}) error

func (*Controller) SetHttpStatus

func (obj *Controller) SetHttpStatus(code int)

type IController

type IController interface {
	Prepare(c context.Context, ctx *app.RequestContext, para interface{}) error
	Execute()
	Finish()
}

type RestResponse

type RestResponse struct {
	Code  int    `json:"code"`
	Error string `json:"error,omitempty"`
	Data  any    `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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