We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我想用其他第三方验证器go-tagexpr或者自己的验证器来替换默认的validator.Do,虽然可以用func Register(cb callback)追加自己的验证器插件,但运行时默认的validator.Do都会被执行一遍,虽然不影响结果,但总感觉不够完美。好吧,我有强迫症😀😀😀
validator.Do
func Register(cb callback)
The text was updated successfully, but these errors were encountered:
Hi, why should we import other validator ? any feature is not supported by the origin one ?
Sorry, something went wrong.
如果是想做的更灵活,你的实现又显得有些定制
我们的想法是让用户可以自己决定使用什么验证器(至少可以选择一些流行的库),validator本身也是第三方导入的库,使用go-tagexpr是因为我们在一些旧的业务系统中已经使用了它,现在需要升级老的MongoDB Driver,我们打算用qmgo替换mgo,如果能完美兼容其他验证器,我们就可以减少很多替换验证器的工作了。 现在的实现使用断言类型显得有些定制,如果我把第三方验证器做一层浅的封装,再抽象出一个验证的接口来使用,你觉得这个方案如何?如果可行我就这样改一版。
嗯,如果要做到插件式,应该是把所有的实现都接口化,然后各自实现 不过其实不如趁着次切到validator
No branches or pull requests
我想用其他第三方验证器go-tagexpr或者自己的验证器来替换默认的
validator.Do
,虽然可以用func Register(cb callback)
追加自己的验证器插件,但运行时默认的validator.Do
都会被执行一遍,虽然不影响结果,但总感觉不够完美。好吧,我有强迫症😀😀😀The text was updated successfully, but these errors were encountered: