Releases: xgfone/ship
Releases · xgfone/ship
v3.0.0
- Added:
- Add the method
Router()
to get the router of the host. - Add the method
Clone()
forRoute
andRouteGroup
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 forhttp.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.
- Add the method
- Changed:
- The route name is based on the host router, not the global.
- The
Logger
middleware no longer supports thenow
argument. - Change the interface
Router
to allow the user to get the routes and delete the routes.
- Removed:
- Remove the field
Router
from the typeRouteInfo
. - Remove the function
ReadNWriter
and useCopyNBuffer
instead. - Remove the method
SetGetURL
fromContext
, andURL()
generates the url based on the current context router.
- Remove the field
v2.5.1
v2.5.0
v2.4.2
v2.4.1
v2.4.0
v2.3.0
v2.1.1
v2.1.0
v2.0.0
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
fromGroup
, and add the new methodNoMiddleware
.
- Remove the useless
- Changed:
- Change the interface
Logger
. - Change the interface
Router
and remove the routerLockedRouter
. - Change the interface
Binder
fromBind(ctx *Context, v interface{}) error
toBind(req *http.Request, v interface{}) error
. - Change the interface
Renderer
fromRender(ctx *Context, name string, code int, data interface{}) error
toRender(w http.ResponseWriter, name string, code int, data interface{}) error
.
- Change the interface
- Others:
- Rename the group
Group
toRouteGroup
. - Update the
Response
and adds some new methods. - Split the HTTP Server from
Ship
to the individualRunner
. - Move
HTTPError
,Binder
,Renderer
,Session
to the individual sub-packages.
......
- Rename the group