Documentation ¶
Index ¶
- Variables
- func CreateHTTPServer()
- func GetVersion() int
- func RegisterGetHandle(subPath string, handle Handle)
- func RegisterGetHandleNoUserID(subPath string, handle Handle)
- func RegisterPostHandle(subPath string, handle Handle)
- func RegisterPostHandleNoUserID(subPath string, handle Handle)
- type Config
- type Context
- type Handle
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Conf = Config{ Port: 15001, Test: true, } Flags = []cli.Flag{ &cli.IntFlag{ Name: "HTTP_PORT", Value: 5001, Usage: "-HTTP_PORT 7001", EnvVars: []string{"HTTP_PORT"}, Destination: &Conf.Port, }, &cli.BoolFlag{ Name: "HTTP_TEST", Value: true, Usage: "-HTTP_TEST true", EnvVars: []string{"HTTP_TEST"}, Destination: &Conf.Test, }, } )
View Source
var (
Ctx context.Context
)
Functions ¶
func CreateHTTPServer ¶
func CreateHTTPServer()
func RegisterGetHandle ¶
RegisterGetHandle 注册http get handle
func RegisterGetHandleNoUserID ¶
RegisterGetHandleNoUserID 注册http post handle
func RegisterPostHandle ¶
RegisterPostHandle 注册http post handle
func RegisterPostHandleNoUserID ¶
RegisterPostHandleNoUserID 注册http post handle
Types ¶
type Context ¶
type Context struct { Rds redis.Conn Db *xorm.Engine MqChannel *mqwrap.MqChannel UserID string Query url.Values Params httprouter.Params Body []byte W http.ResponseWriter Ctx context.Context // contains filtered or unexported fields }
func (*Context) GetHTTPRequest ¶
GetHTTPRequest 获取请求信息
func (*Context) WriteRsp ¶
func (ctx *Context) WriteRsp(m *pb.HTTPResponse)
WriteRsp send protobuf messsage to peer
Click to show internal directories.
Click to hide internal directories.