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

proxy.golang.org : github.com/jackc/softstruct

Package softstruct provides "soft" structures that are created at runtime. The purpose of this package is to make it easy to parse and validate JSON or form submissions and to represent a runtime defined record. A Type is a definition of a structure. It is defined by a set of fields. Each field has a name and a set of ValueConverters. A ValueConverter is a function that converts a value to a different type or validates the value. A Record is an "instance" of a Type. It is created by calling Type.New with a map[string]any. The map is converted to a Record by applying the ValueConverters for each field. If any of the ValueConverters fail then the Record is considered invalid. The original map and the errors are stored in the Record.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/jackc/softstruct
License: MIT
Latest release: almost 2 years ago
First release: almost 2 years ago
Namespace: github.com/jackc
Stars: 1 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 7 days ago

    Loading...
    Readme
    Loading...