Ecosyste.ms: Repos

An open API service providing repository metadata for many open source software ecosystems.

Package Usage: go: github.com/mitchellh/mapstructure

Package mapstructure exposes functionality to convert one arbitrary Go type into another, typically to convert a map[string]interface{} into a native Go structure. The Go structure can be arbitrarily complex, containing slices, other structs, etc. and the decoder will properly decode nested maps and so on into the proper structures in the native Go struct. See the examples to see what the decoder is capable of. The simplest function to start with is Decode. When decoding to a struct, mapstructure will use the field name by default to perform the mapping. For example, if a struct has a field "Username" then mapstructure will look for a key in the source value of "username" (case insensitive). You can change the behavior of mapstructure by using struct tags. The default struct tag that mapstructure looks for is "mapstructure" but you can customize it using DecoderConfig. To rename the key that mapstructure looks for, use the "mapstructure" tag and set a value directly. For example, to change the "username" example above to "user": Embedded structs are treated as if they're another field with that name. By default, the two structs below are equivalent when decoding with mapstructure: This would require an input that looks like below: If your "person" value is NOT nested, then you can append ",squash" to your tag value and mapstructure will treat it as if the embedded struct were part of the struct directly. Example: Now the following input would be accepted: When decoding from a struct to a map, the squash tag squashes the struct fields into a single map. Using the example structs from above: Will be decoded into a map: DecoderConfig has a field that changes the behavior of mapstructure to always squash embedded structs. If there are any unmapped keys in the source value, mapstructure by default will silently ignore them. You can error by setting ErrorUnused in DecoderConfig. If you're using Metadata you can also maintain a slice of the unused keys. You can also use the ",remain" suffix on your tag to collect all unused values in a map. The field with this tag MUST be a map type and should probably be a "map[string]interface{}" or "map[interface{}]interface{}". See example below: Given the input below, Other would be populated with the other values that weren't used (everything but "name"): When decoding from a struct to any other value, you may use the ",omitempty" suffix on your tag to omit that value if it equates to the zero value. The zero value of all types is specified in the Go specification. For example, the zero type of a numeric type is zero ("0"). If the struct field value is zero and a numeric type, the field is empty, and it won't be encoded into the destination type. Since unexported (private) struct fields cannot be set outside the package where they are defined, the decoder will simply skip them. For this output type definition: Using this map as input: The following struct will be decoded: mapstructure is highly configurable. See the DecoderConfig struct for other features and options that are supported.
17 versions
Latest release: almost 2 years ago
32,864 dependent packages

View more package details: https://packages.ecosyste.ms/registries/proxy.golang.org/packages/github.com/mitchellh/mapstructure

View more repository details: https://repos.ecosyste.ms/hosts/GitHub/repositories/mitchellh%2Fmapstructure

Dependent Repos 124,571

admariner/jitsu Fork of jitsucom/jitsu
Jitsu is an open-source data integration platform
  • v1.4.1 configurator/backend/go.mod
  • v0.0.0-20160808181253-ca63d7c062ee configurator/backend/go.sum
  • v1.1.2 configurator/backend/go.sum
  • v1.4.1 configurator/backend/go.sum
  • v1.4.1 server/go.mod
  • v0.0.0-20160808181253-ca63d7c062ee server/go.sum
  • v1.1.2 server/go.sum
  • v1.4.1 server/go.sum

Size: 29.4 MB - Last synced: 8 days ago - Pushed: 9 months ago

kmodules/resource-metadata
API for defining metadata about Kubernetes resources
  • v1.5.0 go.mod
  • v0.0.0-20160808181253-ca63d7c062ee go.sum
  • v1.1.2 go.sum
  • v1.4.1 go.sum
  • v1.5.0 go.sum

Size: 75.1 MB - Last synced: 7 days ago - Pushed: 7 days ago

brotherlogic/logging
Logging for system
  • v0.0.0-20160808181253-ca63d7c062ee go.sum
  • v1.1.2 go.sum

Size: 597 KB - Last synced: 12 days ago - Pushed: 12 days ago

vearutop/cache-story
Demo repository for a blog post.
  • v0.0.0-20160808181253-ca63d7c062ee go.sum
  • v1.1.2 go.sum

Size: 4.59 MB - Last synced: about 1 month ago - Pushed: about 1 month ago

ossf/scorecard-action
Official GitHub Action for OpenSSF Scorecard.
  • v1.5.0 go.mod
  • v0.0.0-20160808181253-ca63d7c062ee go.sum
  • v1.1.2 go.sum
  • v1.3.1 go.sum
  • v1.3.2 go.sum
  • v1.3.3 go.sum
  • v1.4.0 go.sum
  • v1.4.1 go.sum
  • v1.4.2 go.sum
  • v1.4.3 go.sum
  • v1.5.0 go.sum

Size: 6.5 MB - Last synced: about 10 hours ago - Pushed: about 11 hours ago

zeromike/syft Fork of anchore/syft
CLI tool and library for generating a Software Bill of Materials from container images and filesystems
  • v1.5.0 go.mod
  • v0.0.0-20160808181253-ca63d7c062ee go.sum
  • v1.1.2 go.sum
  • v1.3.2 go.sum
  • v1.3.3 go.sum
  • v1.4.0 go.sum
  • v1.4.1 go.sum
  • v1.4.2 go.sum
  • v1.4.3 go.sum
  • v1.5.0 go.sum

Size: 10.4 MB - Last synced: 10 months ago - Pushed: almost 2 years ago

aberja/argo Fork of argoproj/argo-workflows
Argo Workflows: Get stuff done with Kubernetes.
  • v1.5.0 go.mod
  • v0.0.0-20160808181253-ca63d7c062ee go.sum
  • v0.0.0-20180220230111-00c29f56e238 go.sum
  • v1.1.2 go.sum
  • v1.3.2 go.sum
  • v1.3.3 go.sum
  • v1.4.0 go.sum
  • v1.4.1 go.sum
  • v1.4.3 go.sum
  • v1.5.0 go.sum

Size: 67.2 MB - Last synced: about 1 year ago - Pushed: about 1 year ago

krasish/test-infra Fork of kyma-project/test-infra
Test infrastructure for the Kyma project.
  • v0.0.0-20160808181253-ca63d7c062ee development/gcp/cloud-functions/getfailureinstancedetails/go.sum
  • v1.1.2 development/gcp/cloud-functions/getfailureinstancedetails/go.sum
  • v1.3.1 development/gcp/cloud-functions/getfailureinstancedetails/go.sum
  • v1.3.2 development/gcp/cloud-functions/getfailureinstancedetails/go.sum
  • v1.3.3 development/gcp/cloud-functions/getfailureinstancedetails/go.sum
  • v1.4.0 development/gcp/cloud-functions/getfailureinstancedetails/go.sum
  • v1.4.1 development/gcp/cloud-functions/getfailureinstancedetails/go.sum
  • v1.4.2 development/gcp/cloud-functions/getfailureinstancedetails/go.sum
  • v1.4.3 development/gcp/cloud-functions/getfailureinstancedetails/go.sum
  • v0.0.0-20160808181253-ca63d7c062ee development/kyma-ci-force-bot/ciforcebot/go.sum
  • v1.1.2 development/kyma-ci-force-bot/ciforcebot/go.sum
  • v1.3.1 development/kyma-ci-force-bot/ciforcebot/go.sum
  • v1.3.2 development/kyma-ci-force-bot/ciforcebot/go.sum
  • v1.3.3 development/kyma-ci-force-bot/ciforcebot/go.sum
  • v1.4.0 development/kyma-ci-force-bot/ciforcebot/go.sum
  • v1.4.1 development/kyma-ci-force-bot/ciforcebot/go.sum
  • v1.1.2 development/test-log-collector/go.sum
  • v0.0.0-20160808181253-ca63d7c062ee go.sum
  • v1.1.2 go.sum
  • v1.3.1 go.sum
  • v1.3.2 go.sum
  • v1.3.3 go.sum
  • v1.4.0 go.sum
  • v1.4.1 go.sum
  • v1.4.2 go.sum
  • v1.4.3 go.sum

Size: 15.3 MB - Last synced: about 1 year ago - Pushed: about 1 year ago

ffuf-glanz/terraform-provider-azuredevops Fork of feilfeilundfeil/terraform-provider-azuredevops
Terraform provider for Azure DevOps
  • v1.1.2 go.sum

Size: 19.8 MB - Last synced: about 1 year ago - Pushed: about 1 year ago

bytebuilders/installer
  • v1.1.2 go.sum

Size: 17.7 MB - Last synced: about 7 hours ago - Pushed: about 10 hours ago

luthersystems/sandbox
End-to-end "hello world" application on the Luther Platform.
  • v1.1.2 go.mod
  • v0.0.0-20160808181253-ca63d7c062ee go.sum
  • v0.0.0-20180511142126-bb74f1db0675 go.sum
  • v1.1.2 go.sum

Size: 423 KB - Last synced: about 1 month ago - Pushed: about 1 month ago

spolti/kie-cloud-operator Fork of kiegroup/kie-cloud-operator
OCP Operator for KIE
  • v1.4.1 go.mod
  • v0.0.0-20160808181253-ca63d7c062ee go.sum
  • v1.1.2 go.sum
  • v1.3.2 go.sum
  • v1.4.1 go.sum

Size: 100 MB - Last synced: 7 months ago - Pushed: 7 months ago

dhis2-sre/im-inspector
  • v1.1.2 go.sum

Size: 334 KB - Last synced: about 1 month ago - Pushed: about 1 month ago

cheqd/tendermint Fork of tendermint/tendermint
⟁ Tendermint Core (BFT Consensus) in Go
  • v0.0.0-20160808181253-ca63d7c062ee go.sum
  • v1.1.2 go.sum
  • v1.4.1 go.sum
  • v1.4.2 go.sum
  • v1.5.0 go.sum
  • v1.5.0 go.mod

Size: 142 MB - Last synced: about 2 months ago - Pushed: about 1 year ago

alicefr/kubevirt Fork of kubevirt/kubevirt
Kubernetes Virtualization API and runtime in order to define and manage virtual machines.
  • v1.1.2 go.sum
  • v1.1.2 staging/src/kubevirt.io/client-go/go.sum

Size: 254 MB - Last synced: about 19 hours ago - Pushed: about 20 hours ago

ryanlycch/go-zero-looklook Fork of Mikaelemmmm/go-zero-looklook
🔥基于go-zero(go zero) 微服务全技术栈开发最佳实践项目。Develop best practice projects based on the full technology stack of go zero (go zero) microservices.
  • v1.1.2 go.sum

Size: 101 MB - Last synced: about 2 months ago - Pushed: about 2 months ago

ahmedabu98/beam Fork of apache/beam
Apache Beam is a unified programming model for Batch and Streaming
  • v0.0.0-20160808181253-ca63d7c062ee playground/backend/go.sum
  • v1.1.2 playground/backend/go.sum
  • v1.1.2 sdks/go.sum

Size: 364 MB - Last synced: about 11 hours ago - Pushed: about 12 hours ago

champ-oss/terraform-aws-metabase
  • v0.0.0-20160808181253-ca63d7c062ee test/src/go.sum
  • v1.1.2 test/src/go.sum

Size: 217 KB - Last synced: about 11 hours ago - Pushed: about 12 hours ago