Skip to content

Releases: xgfone/ship

v1.9.0

10 Sep 08:35
Compare
Choose a tag to compare
  • Added:
    • Use github.com/xgfone/go-tools/v6 instead of github.com/xgfone/go-tools, which requires Go1.11+.
    • Add the method Stop for Ship, which is short for Ship.Shutdown(context.Background()).
    • JSONBinder and XMLBinder do nothing when ContentLength is equal to 0.
  • Changed:
    • Change the supported GO version from 1.7+ to 1.11+.

v1.8.0

10 Aug 12:37
Compare
Choose a tag to compare
  • Added:
    • Context.Error supports the error HTTPError.
    • Add some convenient methods for Context, such as Referer, UserAgent, BasicAuth, FormFile2, MultipartReader, and Context(context.Context).
  • Fixed:
    • Fix some bugs.
  • Others:
    • Enhance the robustness of ContentType and Charset of Context.

v1.7.0

06 Aug 13:14
Compare
Choose a tag to compare
  • Added:
    • Add the route modifier to modify the route before registering it.
    • Add the route filter to filter unacceptable route before registering it.
    • Add some new methods for Context, such as Body(), Path(), Hostname(), RespHeader(), ReqHeader() and SetRequest(newReq).

v1.6.0

31 Jul 13:44
Compare
Choose a tag to compare
  • Added:
    • Add the method MaxNumOfURLParams() for Ship.
    • Add the default global ship DefaultShip and its methods as the global functions.
  • Changed:
    • The method StartServer for Ship returns the itself.

v1.5.0

09 Jul 09:07
Compare
Choose a tag to compare
  • Added:
    • Add the CORS middleware.
    • Add the function FromFunc to convert a function to a middleware.
    • Add the method Error(code, error) for Context to emit the response based on an error.
    • Add the method AddHeader(name, value) for Context to append the value of the header name.
  • Fixed:
    • Fix the stack depth of the builtin implementation of Logger.

v1.4.2

28 Apr 03:29
Compare
Choose a tag to compare
  • Fix: the recursive call of ToContentTypes.
  • Changed: logger middleware output the remoteaddr before others.

v1.4.1

08 Apr 09:17
Compare
Choose a tag to compare
  • Fix: Allow the Content-Type header contains others between the content-type and charset, such as Content-Type: application/json; version=1.0; charset=utf-8.

v1.4.0

08 Apr 08:45
Compare
Choose a tag to compare
  • Export the function ToContentTypes.
  • Add the method Ship() for Group to allow it to acquire the ship that it belongs to.
  • Add the method Ship() and Group() for Route to acquire the ship and the group that it belongs to.

v1.3.0

03 Apr 09:53
Compare
Choose a tag to compare
  • Add the method NewCT(), GetMsg() and GetError() for HTTPError to make it more common.
  • Update the Logger middleware: detect the error HTTPError and log the error that the code is less than 500 by the level INFO, not ERROR.

v1.2.1

01 Apr 08:44
Compare
Choose a tag to compare
  • Benchmark supports go module.
  • The Logger middleware output the remote address.