Ejemplo n.º 1
0
func PlaintextHandler(ctx *fasthttp.RequestCtx) {
	ctx.SetContentType("text/plain")
	ctx.WriteString("Hello, World!")
}
Ejemplo n.º 2
0
Archivo: main.go Proyecto: 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)
	}
}
Ejemplo n.º 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")
}
Ejemplo n.º 5
0
func status404(ctx *fasthttp.RequestCtx) {
	ctx.SetStatusCode(fasthttp.StatusNotFound)
	ctx.WriteString("Image not found!")
}