Releases: go-seatbelt/seatbelt
v0.4.0
v0.3.2
Forces the CSRF cookie to use the path /
to prevent issues with there being two CSRF token cookies with a different path.
v0.3.1
Adds a method to render a template to a byte slice, rather than directly to the response writer, for example
func ShowPage(c *seatbelt.Context) error {
page := c.RenderToBytes("index", nil)
_, err := c.Response().Write(page)
return err
}
renders a page to a byte slice, then writes it to the response.
v0.3.0
Adds Chi's route
to the Seatbelt application's router via the method Namespace
.
This allows sub-routes to be created, as follows:
app := app.New()
app.Namespace("/admin", func(app *seatbelt.App) {
app.Get("/home", func(c *seatbelt.Context) error {
return c.String(200, "ok")
})
})
app.Start()
This will return 200 with the body "ok" when a request is sent to /admin/home
.
v0.2.0
Adds namespaces to the context methods to more clearly group them by functionality, i.e., methods affecting the session are now accessed via,
func Handle(c *seatbelt.Context) error {
c.Session.Set("key", "value")
return nil
}
This also adds a helper to approximate the IP address of a request.
Updates the "values" API so that it used the request context for storage, rather than relying on a per-request map stored in the context instance.
This allows us to create arbitrary "values" instances from requests, which makes it possible to interact with this API anytime we have an HTTP request. This was required to merge the request-scoped "values" in the I18N template helper, which was (in my opinion) required to make it consistent with how the HTML rendering API and its usage of "values"feels.
Adds the same "reload" ability to i18n bundles that we have on HTML templates, so that in development, i18n bundles are re-compiled on each request, so they can be edited while a dev server is running without requiring a reload.
v0.1.1
- Adds a basic implementation of i18n via https://github.com/nicksnyder/go-i18n. You can use the new
t
built-in helper func, or callc.I18n.T
in Go.
v0.1.0
- Adds the "Values" API, which allows the setting of request-scoped values.
- Rips out the old custom template renderer, and switches to using
github.com/unrolled/render
.
v0.0.4
What's Changed
- seatbelt: generate unique secret signing key by @bentranter in #5
- all: version public assets, improve sessions by @bentranter in #6
Full Changelog: v0.0.3...v0.0.4
v0.0.3
- Removes the
x
package, and along with it, a ton of unused dependencies.
v0.0.2
First release post-rewrite. Probably not a good idea to use this yet.