grpc 第三方依赖 就是grpc的 third_party 文件夹
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
captainfffsama 1297acf91b v1.41.0 2 years ago
..
protoc_gen_validate v1.41.0 2 years ago
BUILD v1.41.0 2 years ago
README.md v1.41.0 2 years ago
pyproject.toml v1.41.0 2 years ago
requirements.in v1.41.0 2 years ago
setup.cfg v1.41.0 2 years ago

README.md

Protoc-gen-validate (PGV)

While protocol buffers effectively guarantee the types of structured data, they cannot enforce semantic rules for values. This package is a python implementation of protoc-gen-validate, which allows for runtime validation of various semantic assertions expressed as annotations on the protobuf schema. The syntax for all available annotations is in validate.proto. Implemented Python annotations are listed in the rules comparison.

Example

from entities_pb2 import Person
from protoc_gen_validate.validator import validate, ValidationFailed

p = Person(first_name="Foo", last_name="Bar", age=42)
try:
    validate(p)
except ValidationFailed as err:
    print(err)