corehttp

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartApi

func StartApi(ctx *context.CoreContext) error

Types

type AddDuration added in v1.1.0

type AddDuration struct {
	Duration uint16 `json:"duration"`
}

type BootParam added in v1.1.0

type BootParam struct {
	Option bool `json:"option"`
}

type ChangePrice added in v1.1.0

type ChangePrice struct {
	Price uint64 `json:"price"`
}

type HandlerFunc

type HandlerFunc func(c *MyContext)

type Keys

type Keys struct {
	PublicKey string `json:"public_key"`
}

type MyContext

type MyContext struct {
	*gin.Context
	CoreContext *context.CoreContext
}

MyContext extend gin.Context

type MyRouterGroup

type MyRouterGroup struct {
	*gin.RouterGroup
	CoreContext *context.CoreContext
}

MyRouterGroup extend gin.RouterGroup

func (*MyRouterGroup) GET

func (r *MyRouterGroup) GET(relativePath string, handlers ...HandlerFunc) gin.IRoutes

GET extend group GET

func (*MyRouterGroup) Group

func (group *MyRouterGroup) Group(relativePath string, handlers ...HandlerFunc) *MyRouterGroup

func (*MyRouterGroup) POST

func (r *MyRouterGroup) POST(relativePath string, handlers ...HandlerFunc) gin.IRoutes

POST extend group POST

func (*MyRouterGroup) Use

func (r *MyRouterGroup) Use(middlewares ...func(c *MyContext)) gin.IRoutes

Use extend register with middle

type MyServer

type MyServer struct {
	*gin.Engine
	CoreContext *context.CoreContext
}

func NewMyServer

func NewMyServer(ctx *context.CoreContext) *MyServer

NewMyServer new gin server

func (*MyServer) GET

func (server *MyServer) GET(relativePath string, handlers ...HandlerFunc) gin.IRoutes

GET extent GET

func (*MyServer) Group

func (server *MyServer) Group(relativePath string, handlers ...HandlerFunc) *MyRouterGroup

Group rewrite route register

func (*MyServer) POST

func (server *MyServer) POST(relativePath string, handlers ...HandlerFunc) gin.IRoutes

POST extend POST

type Result added in v1.1.0

type Result struct {
	Code    uint64      `json:"code"`
	Type    string      `json:"type"`
	Message string      `json:"message"`
	Result  interface{} `json:"result"`
}

func BadRequest added in v1.1.0

func BadRequest(message ...string) Result

func Success added in v1.1.0

func Success(result interface{}) Result

type UnitPriceParam added in v1.1.0

type UnitPriceParam struct {
	UnitPrice uint64 `json:"unitPrice"`
}

Jump to

Keyboard shortcuts

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