Skip to content

feat: Add ApplyConfig in NotNet engine#1

Merged
Not-Dhananjay-Mishra merged 3 commits intomainfrom
applyconfig
Apr 6, 2026
Merged

feat: Add ApplyConfig in NotNet engine#1
Not-Dhananjay-Mishra merged 3 commits intomainfrom
applyconfig

Conversation

@Not-Dhananjay-Mishra
Copy link
Copy Markdown
Contributor

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra commented Apr 6, 2026

Added ApplyConfig in NotNet engine
with this we can now apply custom config for any particular route

Example :

// This route will override the engine timeouts with custom values
app.GET("/long-timeout", func(req *notnet.Request, resp *notnet.Response) error {
	resp.HTML(200, "<html>Hello NotNet</html>")
	return nil
}).ApplyConfig(&notnet.EngineOption{
	ReadTimeout:  20 * time.Second,
	WriteTimeout: 40 * time.Second,
})

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra changed the title feat: Add ApplyConfig in NotNet engine feat: Add ApplyConfig in NotNet engine Apr 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an ApplyConfig chaining API intended to let callers apply EngineOption configuration after route/group registration, plus adds expanded GoDoc comments, tests, and a usage example.

Changes:

  • Add Engine.ApplyConfig(*EngineOption) and Group.ApplyConfig(*EngineOption) chaining methods.
  • Expand documentation comments across request/response helpers and engine APIs.
  • Add tests and an example file demonstrating ApplyConfig usage.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
pkg/notnet/reqandresp.go Adds/expands GoDoc comments for request/response helpers and pooling functions.
pkg/notnet/notnet.go Adds ApplyConfig to Engine and Group; expands GoDoc comments for engine APIs.
pkg/notnet/notnet_test.go Adds tests covering ApplyConfig behavior (currently not asserting actual config effects, and includes a timing-based test).
example/applyconfig.go Adds an example snippet demonstrating chained ApplyConfig usage (currently not invoked by the runnable example).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/notnet/notnet.go Outdated
Comment thread pkg/notnet/notnet.go Outdated
Comment thread pkg/notnet/notnet.go Outdated
Comment thread pkg/notnet/notnet_test.go
Comment thread pkg/notnet/notnet_test.go Outdated
Comment thread example/applyconfig.go
Comment thread pkg/notnet/notnet.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…r ApplyConfig

Agent-Logs-Url: https://github.com/nottechdm/notnet/sessions/9c9a2ffd-6399-4c01-a802-1eac6709a640

Co-authored-by: Not-Dhananjay-Mishra <218332346+Not-Dhananjay-Mishra@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants