Skip to content

Conversation

Degfy
Copy link
Member

@Degfy Degfy commented May 25, 2025

No description provided.

dapeng added 13 commits May 22, 2025 22:09
- Add support for injecting various types of parameters in Gin handlers
- Implement parsers for different data types including struct, slice, map, and basic types
- Add name-based and type-based parameter injection
- Implement query parameter binding for both single and multiple values
- Add support for binding HTTP request, response writer, and context
- Implement unit tests for delay bind injector and parsers
- Add support for parsing all query parameters as a string
- Implement parsing for struct and map types using BindQuery
- Add handling for slice types in query parameters
- Improve error handling and add more test cases for query parsing
… and types

- Add test cases for NameParser interface for cookies, headers, and params
- Implement tests for TypeParser interface for various types (context, response, request, URL)
- Add load test to verify parser initialization
- Update httpRequestTypeParser and urlTypeParser to return correct types
- Rename and reorganize files for better structure
- Update import paths to use `internal` package
- Modify `bindExecutor` to use `NameParser` instead of `TypeParser`
- Remove `http_injector.go` and related code
- Add `load.go` for dynamic injector loading
- Add comprehensive tests for bindExecutor initialization and functionality
- Update delay_bind_injector to remove unnecessary UUID generation
- Add Flag embedding to MockNameParser and MockTypeParser for better mocking
…andling

- Update link function to handle struct pointer types
- Add error handling and logging for field setter errors
- Improve test coverage for delay bind injector
- Remove internal Context struct, use *gin.Context directly- Consolidate context type parsers into a single ginContextTypeParser
- Update proxy and injector to work with the new context type
- Add RequestBody and Query structs for improved request handling
…ndling

- Change database name from demo1 to demo in default.properties
- Update user ID type from int64 to uint64 across multiple files
- Refactor user controller to use Token struct instead of raw user ID
- Add tokenParser to handle token extraction in routes- Update router initialization to include tokenParser
- Add overview section to introduce HttpInjector and its components
- Detail core components: HttpInjector, DelayBindInjector, and BindExecutor- Explain supported types and labels for injection
- Include examples for each injection type
- Describe implementation principles and core code
- Add advanced usage examples, including custom parsers
- Clarify performance optimizations and error handling
- Improve document structure and readability
Refactor and enhance the HTTP injection documentation to improve readability and correctness. This includes fixing typos, updating examples, and ensuring consistency between the English and Chinese versions. The changes also clarify the usage of custom parameter parsers and improve the overall structure of the documentation.
- Update github.com/gin-gonic/gin from v1.10.0 to v1.10.1
- Remove unused imports
- Update go.mod and go.sum files
- Make minor code adjustment in controller.go
…nding

- Add mock implementation for DelayBindInjector interface
- Enhance query binding logic to support wildcard and improve nil handling
- Update proxy to include time statistics and improve argument processing
- Add unit tests for proxy functionality
- Add new test for injector BuildLoad function
- Enhance proxy test to include request body handling
- Update proxy test to use JSON content type and body
- Improve proxy test to verify request body deserialization
@Degfy Degfy self-assigned this May 25, 2025
@Degfy Degfy added this to gone plan May 25, 2025
Copy link

codecov bot commented May 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
gin/http_injector.go 100.00% <100.00%> (ø)
gin/injector/bind_executor.go 100.00% <100.00%> (ø)
gin/injector/delay_bind_injector.go 100.00% <100.00%> (ø)
gin/injector/load.go 100.00% <100.00%> (ø)
gin/interface.go 100.00% <100.00%> (ø)
gin/loader.go 100.00% <100.00%> (ø)
gin/parser/help.go 100.00% <100.00%> (ø)
gin/parser/load.go 100.00% <100.00%> (ø)
gin/parser/name_body.go 100.00% <100.00%> (ø)
gin/parser/name_cookie.go 100.00% <100.00%> (ø)
... and 10 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Degfy Degfy merged commit 3b4cae4 into main May 25, 2025
6 checks passed
@Degfy Degfy deleted the feature/gin-update branch May 25, 2025 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant