Skip to content

Releases: xgfone/ship

v3.0.0

04 Jul 03:45
Compare
Choose a tag to compare
  • Added:
    • Add the method Router() to get the router of the host.
    • Add the method Clone() for Route and RouteGroup to clone itself.
    • Add the method DelRoutes() to delete the given routes in bulk.
    • Add the methods like Remove() to remove the given route.
    • Add the function DisalbeRedirect to disable the redirect for http.Client.
    • Add the lock for Ship to access and modify the routes concurrently and safely.
    • Add the route error type RouteError, which is returned when failing to add or delete a route.
  • Changed:
    • The route name is based on the host router, not the global.
    • The Logger middleware no longer supports the now argument.
    • Change the interface Router to allow the user to get the routes and delete the routes.
  • Removed:
    • Remove the field Router from the type RouteInfo.
    • Remove the function ReadNWriter and use CopyNBuffer instead.
    • Remove the method SetGetURL from Context, and URL() generates the url based on the current context router.

v2.5.1

28 Apr 12:59
Compare
Choose a tag to compare
  • Fixed:
    • The builtin directory loader replaces the character \ with / for the filename in order to work well on Windows consistent with UNIX/Linux.

v2.5.0

27 Apr 13:55
Compare
Choose a tag to compare
  • Added:
    • Add the method RenderOk for Context to simply the method Render.
    • Add the html template renderer HTMLTemplateRender implemented by the stdlib html/template.
  • Fixed:
    • SimpleRenderer sets the header Content-Type to the given contentType.

v2.4.2

25 Mar 06:54
Compare
Choose a tag to compare
  • Fixed:
    • Call the shutdown functions in reverse order when stopping the http server runner.

v2.4.1

23 Mar 08:07
Compare
Choose a tag to compare
  • Fix:
    • Handle the path prefix before indexing the /debug/pprof/ for the function HTTPPprofToRouteInfo().

v2.4.0

10 Mar 15:12
Compare
Choose a tag to compare
  • Added:
    • Add the method AddRoutes for RouteGroup to register a set of routes.
  • Changed:
    • AddRoute uses the global middlewares.

v2.3.0

09 Mar 13:11
Compare
Choose a tag to compare
  • Added:
    • Add the methods AddRoute and AddRoutes for Ship to register the route by RouteInfo.
    • Add the function HTTPPprofToRouteInfo() to convert the net/http/pprof handlers to RouteInfos to register the http pprof routes.

v2.1.1

04 Dec 14:03
Compare
Choose a tag to compare
  • Fixed:
    • Remove the method ReadFrom from Response in order to avoid that the wrapped http.ResponseWriter has not implemented the interface io.ReaderFrom.

v2.1.0

27 Nov 03:00
Compare
Choose a tag to compare
  • Added:
    • Add the methods Flush, Hijack, Push, ReadFrom for Response to support the inerface http.Flusher, http.Hijacker, http.Pusher, io.ReaderFrom.

v2.0.0

27 Nov 03:16
Compare
Choose a tag to compare

Refactor:

  • Remove:
    • Remove the useless Matcher.
    • Remove some useless middlewares.
    • Remove the global functions of the default Ship.
    • Remove the ship option, and use the exported field to set them.
    • Remove the Django HTML templates and the HTTP renderer.
    • Remove the method GroupWithoutMiddleware from Group, and add the new method NoMiddleware.
  • Changed:
    • Change the interface Logger.
    • Change the interface Router and remove the router LockedRouter.
    • Change the interface Binder from Bind(ctx *Context, v interface{}) error to Bind(req *http.Request, v interface{}) error.
    • Change the interface Renderer from Render(ctx *Context, name string, code int, data interface{}) error to Render(w http.ResponseWriter, name string, code int, data interface{}) error.
  • Others:
    • Rename the group Group to RouteGroup.
    • Update the Response and adds some new methods.
    • Split the HTTP Server from Ship to the individual Runner.
    • Move HTTPError, Binder, Renderer, Session to the individual sub-packages.
      ......