proxy.golang.org : github.com/go-viper/mapstructure/v2
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, or a zero-length element. 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. And likewise for the URLs field, if the slice is nil or empty, it won't be encoded into the destination type. When decoding from a struct to any other value, you may use the ",omitzero" 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. And likewise for the URLs field, if the slice is nil, it won't be encoded into the destination type. Note that if the field is a slice, and it is empty but not nil, it will still 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.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/go-viper/mapstructure/v2
License: MIT
Latest release: 2 days ago
First release: over 1 year ago
Namespace: github.com/go-viper/mapstructure
Stars: 317 on GitHub
Forks: 24 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 2 days ago
github.com/lumeweb/portal-plugin-s5 v0.1.1
2 versions - Latest release: 12 months ago - 0 stars on GitHubgithub.com/LumeWeb/portal-plugin-s5 v0.1.1
2 versions - Latest release: 12 months ago - 0 stars on GitHubgo.lumeweb.com/portal-plugin-s5 v0.1.1
2 versions - Latest release: 12 months ago - 0 stars on GitHubgithub.com/chenxyzl/viper v1.0.5
Go configuration with fangs5 versions - Latest release: 12 months ago - 0 stars on GitHub
github.com/platoon-cc/platoon-cli v0.0.25
4 versions - Latest release: 12 months ago - 0 stars on GitHubgithub.com/roturaprotocol/juno v1.0.0
1 version - Latest release: 12 months ago - 0 stars on GitHubgithub.com/RoturaProtocol/juno v1.0.0
1 version - Latest release: 12 months ago - 0 stars on GitHubgithub.com/kyma-project/opentelemetry-collector-components v0.1.16
Contains Otel Collector components that are not pushed to upstream (yet) or components that are K...9 versions - Latest release: 12 months ago - 1 stars on GitHub
github.phpd.cn/jaegertracing/jaeger v1.58.1
Package jaeger contains the code for Jaeger backend.81 versions - Latest release: 12 months ago
github.com/blockopsnetwork/telescope v0.2.33
Copyright © 2024 NAME HERE <EMAIL ADDRESS> Licensed under the Apache License, Version 2.0 (the "...27 versions - Latest release: 12 months ago - 0 stars on GitHub
github.com/kuberise/todolist v0.2.0
A simple todo list application for demo6 versions - Latest release: 12 months ago - 0 stars on GitHub
github.phpd.cn/docker/buildx v0.15.1
57 versions - Latest release: about 1 year agogithub.com/datumforge/go-template v0.1.0
package main is the entry point1 version - Latest release: about 1 year ago - 0 stars on GitHub
github.com/tigorlazuardi/redmage v0.1.32
Reddit Image Downloader43 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/katallaxie/fiber-ws-relay v0.3.0
Relay middleware between WebSocket and TCP12 versions - Latest release: about 1 year ago - 2 stars on GitHub
github.com/amitbhanja/nuvlaedge-otc-exporter v0.0.28
An OTC exporter which would convert data into different formats and send to different destination...25 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/conduitio-labs/conduit-connector-pulsar v0.1.0
1 version - Latest release: about 1 year ago - 0 stars on GitHubgithub.com/conduitio-labs/conduit-connector-gcp-pubsub v0.1.0
Conduit connector for Google Cloud Pub/Sub1 version - Latest release: about 1 year ago - 0 stars on GitHub
github.hscsec.cn/mercedes-benz/garm-operator v0.3.2
11 versions - Latest release: about 1 year agogithub.com/preetsarb/opentelemetry-collector-contrib v0.102.1
Contrib repository for the OpenTelemetry Collector1 version - Latest release: about 1 year ago - 0 stars on GitHub
github.com/jonathanhope/armaria v0.0.47
Armaria is a fast, open, and local first bookmarks manager47 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/milad75rasouli/portfolio v0.2.1
Milad75Rasouli's portfolio3 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/amitbhanja/nuvlaedge-otc-receiver v0.0.1
This module creates a custom open telemetry receiver which will receive and process packets accor...1 version - Latest release: about 1 year ago - 0 stars on GitHub
github.com/axoflow/countconnector v0.99.0
Opentelemetry connecor for counting log events, and generating metrics based on them7 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/madsrc/sophrosyne v0.0.3
3 versions - Latest release: about 1 year ago - 1 stars on GitHubgithub.com/fenos/otel-grpc-healthcheck v0.0.3
3 versions - Latest release: about 1 year ago - 0 stars on GitHubgithub.com/bitverse-dao/slinky v1.0.0
19 versions - Latest release: about 1 year agogithub.com/routehub-link/urlvalidator v0.0.6
URLValidator & Seeker Service6 versions - Latest release: about 1 year ago - 1 stars on GitHub
github.com/RouteHub-Link/DomainUtils v0.0.6
URLValidator & Seeker Service6 versions - Latest release: about 1 year ago - 1 stars on GitHub
github.com/routehub-link/domainutils v0.0.6
URLValidator & Seeker Service6 versions - Latest release: about 1 year ago - 1 stars on GitHub
github.com/Dennis8274/opentelemetry-collector/exporter v0.102.1
36 versions - Latest release: about 1 year agogithub.com/dennis8274/opentelemetry-collector/exporter v0.102.1
36 versions - Latest release: about 1 year agogithub.phpd.cn/open-telemetry/opentelemetry-collector v0.102.1
128 versions - Latest release: about 1 year agogithub.com/fsgonz/mule-runtime-master-env-log-receiver/envlogstatsreceiver v1.0.3
18 versions - Latest release: about 1 year agogithub.phpd.cn/open-telemetry/opentelemetry-collector-contrib v0.102.0
151 versions - Latest release: about 1 year agogithub.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema v0.102.0
Deprecated: [v0.92.0] This package is deprecated and will be removed in a future release. See htt...69 versions - Latest release: about 1 year ago - 2,280 stars on GitHub
github.1git.de/bakito/batch-job-controller v1.4.6
25 versions - Latest release: about 1 year agogithub.hscsec.cn/bakito/batch-job-controller v1.4.6
25 versions - Latest release: about 1 year agogithub.xiaoq7.com/bakito/batch-job-controller v1.4.6
25 versions - Latest release: about 1 year agogithub.com/anza-labs/lke-operator v0.1.4
6 versions - Latest release: about 1 year ago - 0 stars on GitHubgithub.com/akerouanton/compose-go/v2 v2.1.2
Reference library for the parsing and loading Compose files17 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/yashmanuda/golang-common v1.0.4
5 versions - Latest release: about 1 year ago - 0 stars on GitHubgithub.com/fsgonz/mule-runtime-master-env-log-receiver/receivermodule v0.0.18
5 versions - Latest release: about 1 year agogithub.com/arthur1/opentelemetry-collector-arthur1/receiver/cloudflaremetricsreceiver v0.2.0
The collection of OpenTelemetry collector components created by Arthur1.2 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/arthur1/opentelemetry-collector-arthur1/receiver/runnreceiver v0.2.0
The collection of OpenTelemetry collector components created by Arthur1.2 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/szinn/go-unifi v0.1.0
1 version - Latest release: about 1 year agogithub.com/fsgonz/otelnetstatsreceiver v0.0.93
53 versions - Latest release: about 1 year ago - 0 stars on GitHubgitlab.com/prostu/backend/common v1.1.4
125 versions - Latest release: about 1 year agogithub.com/fsgonz/otel-net-stats-receiver v0.0.2
otel-net-stats-receiver2 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.xiaoq7.com/open-telemetry/opentelemetry-collector-contrib v0.101.0
150 versions - Latest release: about 1 year agogithub.com/bakito/k8s-event-logger-operator v1.13.11 💰
⚡ k8s event logger operator - logs configured events to stdout in order to not lose them54 versions - Latest release: about 1 year ago - 5 stars on GitHub
github.com/comdex-official/block-sdk v1.4.3
🎨 Programmable Block Builder for Cosmos Chains12 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/skilld-labs/railigentxotel v1.0.12
An opentelemetry collector for Siemens Railigent X13 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/skilld-labs/railigentx-otel-receiver v1.0.12
An opentelemetry collector for Siemens Railigent X4 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/buglloc/aweeting v0.9.5
Meeting timer app for awtrix-light6 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/metajar/tork v1.0.2
A distributed workflow engine3 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/hiroyoshii/opentelemetry-bistreaming/otel v0.3.0
1 version - Latest release: about 1 year ago - 0 stars on GitHubgithub.com/hiroyoshii/opentelemetry-bistreaming/exporter/otlpbistreamexporter v0.3.0
2 versions - Latest release: about 1 year ago - 0 stars on GitHubgithub.com/anddd7/grpcbin v1.1.1
:art: Test grpc connection12 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/Anddd7/grpcbin v1.1.1
:art: Test grpc connection12 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/khulnasoft/go-template v0.1.0
package main is the entry point1 version - Latest release: about 1 year ago - 0 stars on GitHub
github.com/Pukka922/gosimplejwt v0.0.1
1 version - Latest release: about 1 year agogithub.com/pukka922/gosimplejwt v0.0.1
1 version - Latest release: about 1 year agogithub.com/prajithp/traefik/v3 v3.0.1
The Cloud Native Application Proxy2 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/Prajithp/traefik/v3 v3.0.1
The Cloud Native Application Proxy2 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/Prajithp/traefik/v2 v2.11.2
The Cloud Native Application Proxy1 version - Latest release: about 1 year ago - 0 stars on GitHub
github.com/prajithp/traefik/v2 v2.11.2
The Cloud Native Application Proxy1 version - Latest release: about 1 year ago - 0 stars on GitHub
github.phpd.cn/signalfx/splunk-otel-collector v0.100.0
112 versions - Latest release: about 1 year agogithub.com/hbocodelabs/infratest v0.10.0
A Golang library for testing infrastructure in automated ways.15 versions - Latest release: about 1 year ago - 17 stars on GitHub
github.com/hboCodeLabs/infratest v0.10.0
A Golang library for testing infrastructure in automated ways.15 versions - Latest release: about 1 year ago - 17 stars on GitHub
github.com/HBOCodeLabs/infratest v0.10.0
A Golang library for testing infrastructure in automated ways.15 versions - Latest release: about 1 year ago - 17 stars on GitHub
github.com/flxpeters/redfish_exporter v0.2.0
Prometheus Exporter to get metrics from Redfish enabled hardware servers. Fork of jenningsloy318/...3 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.phpd.cn/quicksilver-zone/quicksilver v1.5.6
154 versions - Latest release: about 1 year agogithub.com/overorion/opentelemetry-collector/exporter v0.98.0-bytesbothsizergauge2
OpenTelemetry Collector4 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/overorion/opentelemetry-collector/receiver v0.98.0-bytesbothsizergauge2
OpenTelemetry Collector4 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/overorion/opentelemetry-collector v0.98.0-bytesbothsizergauge2
OpenTelemetry Collector6 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/jacktomcat/opentelemetry-collector-contrib v0.99.0
Contrib repository for the OpenTelemetry Collector2 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/wkk778/clickhouseexporter v0.1.0
1 version - Latest release: about 1 year ago - 0 stars on GitHubgithub.com/overorion/opentelemetry-collector-contrib/pkg/stanza v0.98.0-bytesbothsizer2
Contrib repository for the OpenTelemetry Collector3 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/AlexandruBun/opentelemetry-collector-contrib/exporter/kafkaexporter v0.100.0
Package kafkaexporter exports trace data to Kafka.75 versions - Latest release: about 1 year ago
github.com/ksmagyn/opentelemetry-collector-contrib/internal/coreinternal v0.100.0
73 versions - Latest release: about 1 year agogithub.com/alexandrubun/opentelemetry-collector-contrib/exporter/kafkaexporter v0.100.0
75 versions - Latest release: about 1 year agogithub.com/AlexandruBun/opentelemetry-collector-contrib/internal/coreinternal v0.100.0
72 versions - Latest release: about 1 year agogithub.com/alexandrubun/opentelemetry-collector-contrib/internal/coreinternal v0.100.0
72 versions - Latest release: about 1 year agogithub.com/ksmagyn/opentelemetry-collector-contrib v0.100.0
Contrib repository for the OpenTelemetry Collector152 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/nalekseevs/itns-golangci-lint v1.0.2
Fast linters Runner for Go2 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/tvaintrob/otel-collector-nifi-receiver v0.6.0
10 versions - Latest release: about 1 year ago - 0 stars on GitHubgithub.com/OverOrion/opentelemetry-collector/exporter/debugexporter v0.98.0-bytesboth
3 versions - Latest release: about 1 year agogithub.com/overorion/opentelemetry-collector/exporter/debugexporter v0.98.0-bytesboth
3 versions - Latest release: about 1 year agogithub.com/toversus/opentelemetry-collector-contrib v0.99.0
Contrib repository for the OpenTelemetry Collector1 version - Latest release: about 1 year ago - 0 stars on GitHub
github.com/toversus/opentelemetry-collector-contrib/receiver/journaldreceiver v0.99.0
Contrib repository for the OpenTelemetry Collector1 version - Latest release: about 1 year ago - 0 stars on GitHub
github.com/hyperdxio/opentelemetry-collector-contrib v0.99.0
Contrib repository for the OpenTelemetry Collector3 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/aikopanel/xray-server v0.0.2
Modified from XrayR2 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/josephschorr/spicedb v1.32.0
A Zanzibar-inspired database that stores, computes, and validates application permissions22 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/antimetal/terraform-provider-antimetal v0.0.2
2 versions - Latest release: about 1 year ago - 0 stars on GitHubgithub.com/madvikinggod/otel-semconv-checker v0.0.20
20 versions - Latest release: about 1 year ago - 1 stars on GitHubgithub.com/kristofgyuracz/opentelemetry-collector-contrib v0.99.0
Contrib repository for the OpenTelemetry Collector149 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.chickoi.com/open-telemetry/opentelemetry-collector-contrib v0.99.0
56 versions - Latest release: about 1 year agogithub.com/kristofgyuracz/opentelemetry-collector-contrib/connector/countconnector v0.99.0
Contrib repository for the OpenTelemetry Collector40 versions - Latest release: about 1 year ago - 0 stars on GitHub
github.com/leorinat/opentelemetry-collector-contrib v0.99.0
Contrib repository for the OpenTelemetry Collector122 versions - Latest release: about 1 year ago - 0 stars on GitHub
Check this option to include packages that no longer depend on this package in their latest version but previously did.