2 个仓库
Transfers data between Go types by matching fields, methods, and tags at runtime without manual assignment.
Distinct from Reflection-Based Data Binding: Distinct from Reflection-Based Data Binding: focuses on data transfer between types rather than request payload binding.
Explore 2 awesome GitHub repositories matching web development · Reflection-Based Data Mappers. Refine with filters or upvote what's useful.
Copier is a Go library that deep copies data between structs, maps, and slices using reflection-based field mapping and struct tag controls. At its core, it automatically transfers values by matching source and destination fields by name, type, and methods, creating fully independent copies of nested data structures to prevent shared references and unintended mutations. The library distinguishes itself through tag-driven copy rules that give developers fine-grained control over the copying process. Struct tags can enforce mandatory field copying, exclude specific fields from transfer, or map
Transfers data between Go types by matching fields, methods, and tags at runtime.
YYModel 是一个 JSON 模型映射库和双向数据映射器,旨在将原始 JSON 数据转换为结构化模型对象,反之亦然。它充当类型安全的 JSON 解析器,采用自动类型强制转换来防止因解析过程中数据类型不兼容而导致的应用程序崩溃。 该框架使用运行时内省根据命名规则和显式配置将 JSON 键映射到模型属性。它支持通过递归遍历数据层级来实例化嵌套模型对象,并为序列化和反序列化提供了一致的转换层。 其功能涵盖了用于将不匹配的键链接到属性的数据映射逻辑,以及使用 ISO8601 格式标准化日期对象的序列化工作流。该工具使用模式驱动的方法将原始字典转换为结构化对象,以确保网络传输或本地存储的类型安全。
Uses runtime introspection and reflection to instantiate nested models and map data based on predefined naming rules.