Files
akvorado/common/helpers/mapstructure.go
2022-07-21 17:46:01 +02:00

21 lines
718 B
Go

// SPDX-FileCopyrightText: 2022 Free Mobile
// SPDX-License-Identifier: AGPL-3.0-only
package helpers
import "github.com/mitchellh/mapstructure"
var mapstructureUnmarshallerHookFuncs = []mapstructure.DecodeHookFunc{}
// AddMapstructureUnmarshallerHook registers a new decoder hook for
// mapstructure. This should only be done during init.
func AddMapstructureUnmarshallerHook(hook mapstructure.DecodeHookFunc) {
mapstructureUnmarshallerHookFuncs = append(mapstructureUnmarshallerHookFuncs, hook)
}
// GetMapStructureUnmarshallerHooks returns all the registered decode
// hooks for mapstructure.
func GetMapStructureUnmarshallerHooks() []mapstructure.DecodeHookFunc {
return mapstructureUnmarshallerHookFuncs
}