func PlaintextHandler(ctx *fasthttp.RequestCtx) {
	ctx.SetContentType("text/plain")
	ctx.WriteString("Hello, World!")
}
Beispiel #2
0
Datei: main.go Projekt: 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)
	}
}
Beispiel #3
0
// 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)
}
func streamingHandler(ctx *fasthttp.RequestCtx) {
	ctx.WriteString("foobar")
}
Beispiel #5
0
func status404(ctx *fasthttp.RequestCtx) {
	ctx.SetStatusCode(fasthttp.StatusNotFound)
	ctx.WriteString("Image not found!")
}