Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

proxy.golang.org : github.com/lufia/go-validator

Package validator enables strongly-typed Validate methods to validate any types. There are builtin validators. When these builtin validators detects the value is invalid, they returns just an error corresponding to the validator. In other words, they don't return multiple errors wrapped by errors.Join. Also there are few composition validators. These validators wraps multiple validators (including composition validators itself), so it could be contained multiple errors to a returned error from them. To get the details: The New utility function makes it easy to implement custom validators. We highly recommend to set custom error message with WithFormat to that validator. It also has default error message but it might be a unsufficient to your users. The builtin- and compositon-validators has default error messages. Additionally these validators provides to modify its each default message to appropriate message on the situation. For example: It is different for each the validator to be available argument names with ByName. See each the validator documentation. The validators error messages are available in multiple languages. The validator package assumes English is default language. To switch default language to another one, it is set Printer provided by golang.org/x/text/message to ctx that will be passed to the first argument of Validate[T] method.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/lufia/go-validator
Keywords: go, validation, validator
License: BSD-3-Clause
Latest release: 9 months ago
First release: about 1 year ago
Namespace: github.com/lufia
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/lufia
Last synced: 6 days ago

    Loading...
    Readme
    Loading...