コード例 #1
0
func PlaintextHandler(ctx *fasthttp.RequestCtx) {
	ctx.SetContentType("text/plain")
	ctx.WriteString("Hello, World!")
}
コード例 #2
0
ファイル: main.go プロジェクト: phzfi/RIC
// Respond to POST message by saying Hello
func (h MyHandler) RetrieveHello(ctx *fasthttp.RequestCtx) {
	_, err := ctx.WriteString("Hello world!")
	if err != nil {
		log.Println(err)
	}
}
コード例 #3
0
ファイル: handler.go プロジェクト: bentranter/lazyblog
// Info displays info about the available API routes.
func Info(ctx *fasthttp.RequestCtx, _ fasthttprouter.Params) {
	ctx.Response.Header.Set("Content-Type", "application/json")
	ctx.WriteString(routes)
}
コード例 #4
0
func streamingHandler(ctx *fasthttp.RequestCtx) {
	ctx.WriteString("foobar")
}
コード例 #5
0
ファイル: loadimageweb_test.go プロジェクト: phzfi/RIC
func status404(ctx *fasthttp.RequestCtx) {
	ctx.SetStatusCode(fasthttp.StatusNotFound)
	ctx.WriteString("Image not found!")
}