gsrv

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Header(key string, value string) Client
	Do(string, string, ...interface{}) ([]byte, error)
	PostFormFile(url string, file string) ([]byte, error)
}

func NewClient

func NewClient() Client

type Group

type Group interface {
	AddAPI(method string, path string, handler func(*gin.Context)) Group
	Done() Srv
	Use(...gin.HandlerFunc) Group
}

type Resp

type Resp struct {
	ErrNum int         `json:"errcode"`
	ErrMsg string      `json:"errmsg"`
	Data   interface{} `json:"data"`
}

func (Resp) RJSON

func (my Resp) RJSON(c *gin.Context)

type Srv

type Srv interface {
	AddAPI(string, string, func(*gin.Context)) Srv
	G(string) Group
	GetEngine() *gin.Engine
	Run() error
	StaticFs(string) Srv
}

func NewSrv

func NewSrv(ip, port string) Srv

NewSrv 如果传入了错误的port或者ip格式,则默认为127.0.0.1:0

Jump to

Keyboard shortcuts

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