feat: improve resource routing API and add comprehensive quality standards

BREAKING CHANGES:
- Renamed HandleGET -> MemberGET for member-level routes
- Renamed HandlePOST -> MemberPOST for member-level routes
- Renamed HandlePUT -> MemberPUT for member-level routes
- Renamed HandlePATCH -> MemberPATCH for member-level routes
- Renamed HandleDELETE -> MemberDELETE for member-level routes

New Features:
- Added collection-level route methods: GET, POST, PUT, PATCH, DELETE
- Clear distinction between collection (/pattern/action) and member (/pattern/{id}/action) routes
- Comprehensive documentation (README, CONTRIBUTING, QUICKSTART, DOCS)
- Development tooling (Makefile, check.sh script)
- AI coding assistant guidelines (.cursorrules)
- GitHub Actions CI/CD pipeline
- golangci-lint configuration

Code Quality:
- Optimized struct field alignment for better memory usage
- All code passes go vet, staticcheck, and fieldalignment
- All tests pass with race detector
- Go 1.25+ requirement enforced

Documentation:
- Complete README rewrite with examples
- CONTRIBUTING.md with development guidelines
- QUICKSTART.md for new users
- CHANGELOG.md with version history
- SUMMARY.md documenting all changes
- DOCS.md as documentation index
This commit is contained in:
2025-11-15 14:05:11 +05:30
parent 75d2f88c65
commit 26bb9bf5ee
16 changed files with 2850 additions and 139 deletions

View File

@@ -12,47 +12,19 @@ import (
type (
HelmetOption struct {
ContentSecurityPolicy CSP
StrictTransportSecurity *TransportSecurity
// "require-corp" will be the default policy
StrictTransportSecurity *TransportSecurity
XFrameOption XFrame
CrossOriginEmbedderPolicy Embedder
// "same-origin" will be the default policy
CrossOriginOpenerPolicy Opener
// "same-origin" will be the default policy
CrossOriginOpenerPolicy Opener
CrossOriginResourcePolicy Resource
// "no-referrer" will be the default policy
ReferrerPolicy []Referrer
OriginAgentCluster bool
// set true to remove header "X-Content-Type-Options"
DisableSniffMimeType bool
// set true for header "X-DNS-Prefetch-Control: off"
//
// default is "X-DNS-Prefetch-Control: on"
DisableDNSPrefetch bool
// set true to remove header "X-Download-Options: noopen"
DisableXDownload bool
// X-Frame-Options
XFrameOption XFrame
// X-Permitted-Cross-Domain-Policies
//
// default value will be "none"
CrossDomainPolicies CDP
// X-XSS-Protection
//
// default is off
XssProtection bool
CrossDomainPolicies CDP
ReferrerPolicy []Referrer
ContentSecurityPolicy CSP
OriginAgentCluster bool
DisableXDownload bool
DisableDNSPrefetch bool
DisableSniffMimeType bool
XssProtection bool
}
// CSP is Content-Security-Policy settings