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

Top 7.0% on proxy.golang.org
Top 4.6% dependent packages on proxy.golang.org

proxy.golang.org : github.com/creachadair/vql

Package vql implements a reflective query interface to traverse Go values. A vql.Query q describes a sequence of steps in the structure of a compound value (struct, slice, map). For a value v, vql.Eval(q, v) performs the steps described by q starting at v, and reports the value obtained. Decoding loosely-structured data such as JSON or YAML often produces dynamic structures that are highly nested and can be inconvenient to traverse. A vql.Query makes it easier to pick out only the pieces of the value relevant to your particular task. This can be helpful even the type of the structure is statically known, as in the case of configuration scripts with a complex nesting structure. It can also be used to safely inspect variant types with similar shapes. To fetch a named field from a struct, or the value from a map, use vql.Key. You can supply multiple keys to do compound lookups. To index into a slice of values, use vql.Index. To walk sequentially into the structure of a value, use vql.Seq. To apply a subquery to the elements of a slice, use vql.Each. To filter the elements of a slice based on a subquery, use vql.Select. To extract subqueries from a value, use vql.Bind. To apply a functional transformation to a value, use vql.As. To construct a list of subquery values, use vql.List, or vql.Cat to flatten list-valued subqueries. To select one of a sequence of subqueries to apply, use vql.Or. TODO: Add more descriptive errors.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/creachadair/vql
License: MIT
Latest release: over 6 years ago
First release: over 6 years ago
Namespace: github.com/creachadair
Dependent packages: 1
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 23 days ago

    Loading...
    Readme
    Loading...