Customization
Start from zinc.DefaultConfig, change only what your application owns, then construct the app with NewWithConfig.
cfg := zinc.DefaultConfigcfg.CaseSensitive = truecfg.StrictRouting = truecfg.BodyLimit = 8 << 20cfg.ReadTimeout = 10 * time.Secondcfg.WriteTimeout = 20 * time.Second
app := zinc.NewWithConfig(cfg)Replace extension points
Section titled “Replace extension points”cfg := zinc.DefaultConfigcfg.RequestBinder = myBindercfg.Validator = myValidatorcfg.Renderer = myRenderercfg.JSONCodec = myJSONCodeccfg.ErrorHandler = myErrorHandler
app := zinc.NewWithConfig(cfg)Each extension point is a small interface or function type. Implement only the behavior you need.
Standard HTTP middleware
Section titled “Standard HTTP middleware”UseHTTP accepts the normal func(http.Handler) http.Handler shape:
app.UseHTTP(requestTracing, compression)You can also wrap the entire application because *zinc.App implements http.Handler.
Server ownership
Section titled “Server ownership”For complete control over listeners and lifecycle, use app.Handler() with your own http.Server, or pass an existing listener to app.Serve(listener).
