Render

screenshot of Render

Martini middleware/handler for easily rendering serialized JSON, XML, and HTML template responses.

Overview

The render package is a middleware/handler for the Martini framework that enables easy rendering of serialized JSON, XML, and HTML template responses. It uses Go's html/template package for rendering html templates.

Features

  • Easy rendering of serialized JSON, XML, and HTML template responses.
  • Uses Go's html/template package for rendering html templates.
  • Provides a yield function for layouts to access.
  • Automatically sets the proper Content-Type header based on the function called.
  • Allows customization of the character encoding.

Summary

The render package is a middleware/handler for the Martini framework that simplifies the rendering of JSON, XML, and HTML templates. It provides easy-to-use functions for rendering different types of responses and automatically sets the appropriate content type header. It also allows customization of the character encoding.