mvc

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBooleanValueWithDefault

func GetBooleanValueWithDefault(ctx echo.Context, key string, defaultValue bool) bool

func GetIntValueFromAnywhere

func GetIntValueFromAnywhere(ctx echo.Context, key string) int

func GetIntValueWithDefault

func GetIntValueWithDefault(ctx echo.Context, key string, defaultValue int) int

func GetMapValueFromBody

func GetMapValueFromBody(ctx echo.Context) (map[string]interface{}, error)

func GetParamIntValue

func GetParamIntValue(ctx echo.Context, key string) int

func GetRouterPath

func GetRouterPath(matches []string, method reflect.Method) string

func GetValue

func GetValue(ctx echo.Context, key string) string

func GetValueFromAnywhere

func GetValueFromAnywhere(ctx echo.Context, key string) string

func GetValueWithDefault

func GetValueWithDefault(ctx echo.Context, key, defaultValue string) string

func HandlerExtraRouterFunc

func HandlerExtraRouterFunc(controller interface{}, method reflect.Method) echo.HandlerFunc

func HandlerFunc

func HandlerFunc(controller interface{}, method reflect.Method) echo.HandlerFunc

Types

type Application

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

func New

func New(r *echo.Group) *Application

func (*Application) Handle

func (app *Application) Handle(controller interface{})

func (*Application) Prefix

func (app *Application) Prefix(prefix string) *Application

Just For Log Route

type DataResponse

type DataResponse struct {
	Code int         `json:"code"`
	Data interface{} `json:"data"`
}

type EmptyResponse

type EmptyResponse struct {
	Code int `json:"code"`
}

type ExtraRouter

type ExtraRouter interface {
	AddRouter(method, path, methodName string)
	GetItems() []RouterItem
}

func NewExtraRouter

func NewExtraRouter() ExtraRouter

type PageRespMessage

type PageRespMessage struct {
	PageIndex  int         `json:"pageIndex"`
	PageCount  int         `json:"pageCount"`
	TotalCount int         `json:"totalCount"`
	List       interface{} `json:"list"`
}

type RegisterRouter

type RegisterRouter interface {
	RegisterRouter(routers ExtraRouter)
}

type RespMessage

type RespMessage struct {
	Code     int
	Text     string
	Data     interface{}
	Err      error
	Template string
}

func (RespMessage) Dispatch

func (e RespMessage) Dispatch(ctx echo.Context)

implementsResult.

type Result

type Result interface {
	Dispatch(ctx echo.Context)
}

func Error

func Error(code int, err error) Result

func ErrorHtml

func ErrorHtml(code int, err error) Result

func Ok

func Ok(data interface{}) Result

func OkHtml

func OkHtml(template string, data interface{}) Result

type RouterItem

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

type TextResponse

type TextResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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