Documentation
¶
Overview ¶
spell-checker: disable
spell-checker: disable
spell-checker: disable
Index ¶
- func Fuse(restfulPort, grpcPort int, autoRecover bool, withErr bool, ...)
- func Fuse2(restfulPort, grpcPort int, autoRecover bool, withErr bool, ...)
- func SetFuseStatusMessage(call func(status *FuseDefaultStatus, message *FuseDefaultMessage))
- type ClientFuseGRPC
- type FuseContext
- type FuseContextRequest
- type FuseDefaultMessage
- type FuseDefaultStatus
- type FuseOpt
- type FuseResponse
- type FuseResponseMeta
- type FuseRouter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fuse ¶
func Fuse(restfulPort, grpcPort int, autoRecover bool, withErr bool, routes func(router FuseRouter))
func SetFuseStatusMessage ¶
func SetFuseStatusMessage(call func(status *FuseDefaultStatus, message *FuseDefaultMessage))
Types ¶
type ClientFuseGRPC ¶
type ClientFuseGRPC interface {
Restful(path string, header map[string]string, payload map[string]interface{}, params map[string]string) (*grf.Response, error)
}
func ConnectFuseGRPC ¶
func ConnectFuseGRPC(address string) (ClientFuseGRPC, error)
type FuseContext ¶
type FuseContext interface { Request() FuseContextRequest Params(key string, defaultValue ...string) string Query(key string, defaultValue ...string) string Parser(logc *clog.Instance, header, body interface{}) (bool, error) GetMultipartFiles() map[string][]*multipart.FileHeader ClientIP() string Path() string Method() string AuthX() interface{} AuthY() interface{} AuthZ() interface{} SetAuth(authX, authY, authZ interface{}) SetCLog(logc *clog.Instance) GetCLog() *clog.Instance RString(logc *clog.Instance, code int, data string) error RJson(logc *clog.Instance, code int, data interface{}) error RJsonRaw(logc *clog.Instance, code int, data []byte) error R200OK(logc *clog.Instance, data interface{}, opt ...FuseOpt) error R400BadRequest(logc *clog.Instance, message string, opt ...FuseOpt) error R403Forbidden(logc *clog.Instance, message string, opt ...FuseOpt) error R404NotFound(logc *clog.Instance, message string, opt ...FuseOpt) error R406NotAcceptable(logc *clog.Instance, message string, opt ...FuseOpt) error R428PreconditionRequired(logc *clog.Instance, message string, opt ...FuseOpt) error R500InternalServerError(logc *clog.Instance, err error, opt ...FuseOpt) error SetSendResponse(send bool) GetUnSendResponse() *FuseResponse GetUnSendResponseOpt() []FuseOpt }
type FuseContextRequest ¶ added in v1.1.16
type FuseDefaultMessage ¶
type FuseDefaultStatus ¶
type FuseResponse ¶ added in v1.1.48
type FuseResponse struct { Meta FuseResponseMeta `json:"meta"` Data interface{} `json:"data,omitempty"` }
type FuseResponseMeta ¶ added in v1.1.48
type FuseRouter ¶
type FuseRouter interface { Single(path string, handlers ...func(sc FuseContext) error) Group(endpoints map[string][]func(sc FuseContext) error) }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.