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

github.com/stretchr/objx

Package objx provides utilities for dealing with maps, slices, JSON and other data. Objx provides the `objx.Map` type, which is a `map[string]interface{}` that exposes a powerful `Get` method (among others) that allows you to easily and quickly get access to data within the map, without having to worry too much about type assertions, missing data, default values etc. Objx uses a predictable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going: NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong, the rest will be optimistic and try to figure things out without panicking. Use `Get` to access the value you're interested in. You can use dot and array notation too: Once you have sought the `Value` you're interested in, you can use the `Is*` methods to determine its type. Or you can just assume the type, and use one of the strong type methods to extract the real value: If there's no value there (or if it's the wrong type) then a default value will be returned, or you can be explicit about the default value. If you're dealing with a slice of data as a value, Objx provides many useful methods for iterating, manipulating and selecting that data. You can find out more by exploring the index below. A simple example of how to use Objx: Since `objx.Map` is a `map[string]interface{}` you can treat it as such. For example, to `range` the data, do what you would expect:

Ecosystem
proxy.golang.org
Latest Release
v0.5.3
5 months ago
Versions
9
Dependent Packages
20,211
Dependent Repos
267,615
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/stretchr/objx
spec
License MIT
Namespace github.com/stretchr
First Release about 8 years ago
Last Synced about 20 hours ago
Keywords
go golang objx
Repository
Stars 817 on GitHub
Forks 79 on GitHub
Docker Dependents 3,261
Docker Downloads 27,263,500,093
Commits 197
Committers 19
Avg per Author 10.368
DDS 0.609
Rankings on proxy.golang.org
Overall Top 1.1%
Dependent packages Top 0.1%
Dependent repos Top 0.1%
Forks Top 2.9%
Docker downloads Top 0.1%