datamap

package module
v0.0.0-...-6197756 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 9 Imported by: 1

README

datamap

Dépendance(s) extérieure(s) directe(s)


Copyright (c) 2024 Archivage Numérique

Documentation

Index

Constants

View Source
const (
	ErrKeyNotFound = failure.Sentinel("key not found")
)

Variables

This section is empty.

Functions

func Decode

func Decode(out, in any) error

func DecodeJSON

func DecodeJSON(out, in any) error

func DecodeWithConfig

func DecodeWithConfig(dc *mapstructure.DecoderConfig, in any) error

func NewDecoderConfig

func NewDecoderConfig(out any, opts ...Option) *mapstructure.DecoderConfig

Types

type DM

type DM struct {
	// contains filtered or unexported fields
}

func New

func New(name string, data map[string]any) *DM

func (*DM) Data

func (dm *DM) Data() map[string]any

func (*DM) Decode

func (dm *DM) Decode(out any, keys ...string) error

func (*DM) DecodeJSON

func (dm *DM) DecodeJSON(out any, keys ...string) error

func (*DM) DecodeWithConfig

func (dm *DM) DecodeWithConfig(dc *mapstructure.DecoderConfig, keys ...string) error

func (*DM) Get

func (dm *DM) Get(keys ...string) (any, error)

func (*DM) LoadFile

func (dm *DM) LoadFile(name string) error

func (*DM) LoadJSON

func (dm *DM) LoadJSON(data []byte) error

func (*DM) LoadJSONFile

func (dm *DM) LoadJSONFile(name string) error

func (*DM) LoadYAML

func (dm *DM) LoadYAML(data []byte) error

func (*DM) LoadYAMLFile

func (dm *DM) LoadYAMLFile(name string) error

func (*DM) Merge

func (dm *DM) Merge(in map[string]any) error

func (*DM) Name

func (dm *DM) Name() string

func (*DM) Set

func (dm *DM) Set(value any, keys ...string) error

type Option

type Option func(*mapstructure.DecoderConfig)

func WithDefaults

func WithDefaults() Option

func WithTag

func WithTag(name string) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL