Releases: ifreddyrondon/bastion
Releases · ifreddyrondon/bastion
v3.1.0
- 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
- History of changes: see v3.0.2...v3.1.0
v3.0.2
v3.0.2 (2019-04-19)
refactor: mount handlers before serve with an internal router
- History of changes: see v3.0.1...v3.0.2
v3.0.1
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.
- History of changes: see v3.0.0...v3.0.1
v3.0.0
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 optionAPI500ErrMessage
toInternalError
andInternalErrMsg
. breaking changes. PR. - Rename
NoPrettyLogging
option toDisablePrettyLogging
. PR
- History of changes: see v2.3.0...v3.0.0
v2.3.0
- 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
Replace the listing middleware context key by an exportable one to allows testing from outside middleware packages
v2.1.2
Rename field "name" by "description" in Filtering
v2.1.1
- Fix sorting available options duplicated in listing middleware
- Added Sorting value attribute when create a sort criteria
v2.1.0
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
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.