{"repo":"metafates/schema","free":true,"listed":false,"github":"https://github.com/metafates/schema","clone":"git clone https://github.com/metafates/schema.git","description":"📐 Go schema declaration and validation with static types.","language":"Go","stars":83,"topics":["codegen","generics","go","library","validation"],"license":"MIT","category":"dev-tools","readme_excerpt":"📐 Schema Go schema declaration and validation with static types. No field tags or code duplication. Schema is designed to be as developer-friendly as possible. The goal is to eliminate duplicative type declarations. You declare a schema once and it will be used as both schema and type itself. It's easy to compose simpler types into complex data structures. Install: Features - Type-safe - Zero setup required - Zero overhead (can be achieved with optional codegen) - No DSL or code duplication - Cross-field validation support - Helpful errors - Parse arbitrary types into schema. E.g. validate gRPC generated messages by parsing into schema structs. Example See examples for more examples Parsing If needed, you can parse arbitrary types into your schemas through parse package. See parse example for more information. Parsing gRPC messages is also supported, see grpc parse example Validators For a list of available validators see validators Performance TL;DR: you can use codegen for max performance (0-1% overhead) or fallback to reflection (35% overhead). This library does not affect unmarshalling performance itself. You can expect it to be just as fast as a regular unmarshalling. However! Validation, by default, requires reflection to traverse over all struct fields. Again, reflection is only used to traverse fields, validators themself do not use reflection at all. Such reflection traversal introduce 35% performance overhead. As an alternative, you can use schemagen [WIP] to gener","default_branch":null,"files":null,"tree":[],"storefront":"/r/metafates","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/metafates/schema/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}