Skip to content

Releases: gebes/there

Header

28 Jul 14:46
Compare
Choose a tag to compare

Now supporting CanonicalMIMEHeaderKey

Full Changelog: v2.2.9...v2.3.0

Module name

16 Jun 15:03
Compare
Choose a tag to compare

Sanitized module name

Apply default content type

04 May 07:14
Compare
Choose a tag to compare

When no content type is specified, handlers like Json, Xml or String will automatically apply a content type

Default handler and middleware fix

03 May 21:12
Compare
Choose a tag to compare

Mux rework

03 May 19:47
Compare
Choose a tag to compare

Full Changelog: v2.2.0...v2.2.1

Mux rework

03 May 18:40
48bc613
Compare
Choose a tag to compare

Moved headers and statuses to the status and header package
Speed improvement with the built in go mux

What's Changed

New Contributors

Full Changelog: v2.1.3...v2.2.0

Quality of life improvements

16 Apr 18:40
Compare
Choose a tag to compare

Changes to the router configuration

Route not found handler

Override the RouteNotFoundHandler to change default behavior.

//RouterConfiguration is a straightforward place to override default behavior of the router
type RouterConfiguration struct {
	//RouteNotFoundHandler gets invoked, when the specified URL and method have no handlers
	RouteNotFoundHandler Endpoint
}

http.Server

On the router you now got direct access to the http.Server

err := router.Server.Shutdown(context.Background())

Redirect status code

31 Dec 11:34
Compare
Choose a tag to compare

Minor change to the Redirect response

There now provides the option to set the status code for a Redirect response.

func Redirect(code int, url string) HttpResponse {
router.Get("/redirect", func(request HttpRequest) HttpResponse {
	return Redirect(StatusMovedPermanently, "https://google.com")
})

WithHeader bug fix

16 Dec 09:30
19efd95
Compare
Choose a tag to compare

Changes

  • The WithHeader wrapper now only sets header if they haven't been set before.
  • This gives the option to override headers from other responses.

Example

We override the Json response Content-Type header from application/json to application/json; charset=utf-8. Because we set the header to application/json; charset=utf-8 the Header from the Json Response won't be set.

return WithHeaders(MapString{
	"Content-Type": "application/json; charset=utf-8",
}, Json(StatusOK, data))

🥳 Middlewares & Responses Rework and new docs

11 Dec 23:13
Compare
Choose a tag to compare

Gopher There
This release adds many (breaking) changes.

Documentation

To get a clear overview, visit the all-new docs.

Middlewares

Middlewares have been reworked from the ground up to provide the full functionality you would expect from a router. Now you can use all the Middlewares you have ever created in your life, with little to no changes in There!

Previous middlewares still work as they were intended. Only several small things need to be changed

  • Context is now parsed with the request.WithContext(ctx) method
  • Instead of Next() you now return the parsed next parameter

Find more info about the changes in the docs.

HttpResponse

The interface has been reworked, and it is now way easier to implement your own HttpResponses. Also, Msgpack and Yaml have been removed to eliminate all third-party dependencies to make There even more lightweight.

You can find a list of all reworked HttpResponses in the docs.

Most important change

There now has a great new mascot! How do you like it?

Help

If you need help, join our discord or create an issue.