func PlaintextHandler(ctx *fasthttp.RequestCtx) { ctx.SetContentType("text/plain") ctx.WriteString("Hello, World!") }
// 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) } }
// 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") }
func status404(ctx *fasthttp.RequestCtx) { ctx.SetStatusCode(fasthttp.StatusNotFound) ctx.WriteString("Image not found!") }