Skip to content

Releases: ifreddyrondon/bastion

v3.1.0

02 May 01:04
9e596be
Compare
Choose a tag to compare
  • feature: Add wrap response writer middleware. WrapResponseWriter, provides an easy way to capture http related
    metrics from your application's http.Handlers or event hijack the response. PR
  • feature: Add binder support with json, xml and yaml options. PR

v3.0.2

19 Apr 04:19
Compare
Choose a tag to compare

v3.0.2 (2019-04-19)

refactor: mount handlers before serve with an internal router

v3.0.1

15 Apr 21:19
Compare
Choose a tag to compare

fix: mount middleware in main router after init.

After bastion.New and init mux with middlewares, ping and debug handlers if you try to use a middleware the app panic.

v3.0.0

15 Apr 17:28
Compare
Choose a tag to compare

Features

  • Add options for : DisableInternalErrorMiddleware, DisableRecoveryMiddleware, DisablePingRouter PR
  • Expose logger request as a middleware with their config functions. PR
    • AttachLogger(log zerolog.Logger) chain the logger with the middleware.
    • EnableLogReqIP() show the request ip.
    • EnableLogUserAgent() show the user agent of the request.
    • EnableLogReferer() show referer of the request.
    • DisableLogMethod() hide the request method.
    • DisableLogURL() hide the request url.
    • DisableLogStatus() hide the request status.
    • DisableLogSize() hide the request size.
    • DisableLogDuration() hide the request duration.
    • DisableLogRequestID() hide the request id.
  • Add option to disable logger middleware DisableLoggerMiddleware. PR
  • Add debug mode. PR
  • Add default JSON renderer render.JSON PR
  • Add handler for not found resource. PR
  • Add handler for not allowed method in resource. PR
  • Add /debug router used for mounting net/http/pprof. PR

Breaking changes

  • Remove internal router and APIRouter attribute, now the Bastion instance is the mux. breaking changes PR
  • Remove support for load config from file. breaking changes PR
  • Remove address attribute from Config and pass it when Serve or use the default. It also can be set with ADDR env. breaking changes. PR
  • Bastion logger is now internal. It can be used from context. breaking changes. PR
  • Rename APIError middleware including bastion option API500ErrMessage to InternalError and InternalErrMsg. breaking changes. PR.
  • Rename NoPrettyLogging option to DisablePrettyLogging. PR

v2.3.0

05 Apr 21:17
942d213
Compare
Choose a tag to compare
  • Update github.com/go-chi/chi to v4.0.2
  • Update github.com/pkg/errors to 0.8.1
  • Update github.com/rs/zerolog to 1.13.0
  • Remove github.com/gobuffalo/envy dependency
  • Remove github.com/markbates/going dependency
  • History of changes: see v2.2.0...v2.3.0

v2.2.0

18 Dec 23:54
Compare
Choose a tag to compare

Replace the listing middleware context key by an exportable one to allows testing from outside middleware packages

v2.1.2

06 Nov 10:49
5cf4815
Compare
Choose a tag to compare

Rename field "name" by "description" in Filtering

v2.1.1

04 Nov 15:37
1dc5774
Compare
Choose a tag to compare
  • Fix sorting available options duplicated in listing middleware
  • Added Sorting value attribute when create a sort criteria

v2.1.0

26 Aug 23:52
a49457b
Compare
Choose a tag to compare

Description

Add Listing middleware that parses the url from a request and stores a listing.Listing on the context, it can be accessed through middleware.GetListing

v2.0.0

13 Aug 10:14
Compare
Choose a tag to compare
v2.0.0 Pre-release
Pre-release

Description

Bastion instances are created from optional functions. e.g.

// defaults options
bastion.New() 
// turn off pretty print logger and sets address to 0.0.0.0:3000
bastion.New(bastion.NoPrettyLogging(), bastion.Addr("0.0.0.0:3000")) }

Options are:

  • APIBasePath(path string) set path where the bastion api router is going to be mounted.
  • API500ErrMessage(msg string) set the message returned to the user when catch a 500 status error.
  • Addr(add string) bind address provided to http.Server.
  • Env(env string) set the "environment" in which the App is running.
  • NoPrettyLogging() turn off the pretty logging.
  • LoggerLevel(lvl Level) set the logger level.
  • LoggerOutput(w io.Writer) set the logger output writer.

New render methods