Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

home add context for binding validate #4170

Open
fanqingxuan opened this issue Mar 2, 2025 · 0 comments
Open

home add context for binding validate #4170

fanqingxuan opened this issue Mar 2, 2025 · 0 comments

Comments

@fanqingxuan
Copy link

because bind validator use the libaray of https://github.com/go-playground/validator, and user can add custom binding and validation by RegisterValidation, so user maybe query db、cache can some other component for their business,etc check unique from db, then need context parameter for query

bind valid interface original as

type StructValidator interface {
	ValidateStruct(any) error

hope as

type StructValidator interface {
	ValidateStruct(context.Context, any) error
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

No branches or pull requests

1 participant