datamap

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: MIT Imports: 7 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

datamap

Go Reference

TODO


Copyright (c) 2022 Archivage Numérique

Documentation

Overview

Package datamap

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type DecoderConfig

type DecoderConfig struct {
	Tag           string
	DecoderConfig *mapstructure.DecoderConfig
}

type Option

type Option func(*Value)

func WithName

func WithName(name string) Option

type Value

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

func New

func New(data map[string]any, opts ...Option) *Value

func (*Value) Data

func (v *Value) Data() map[string]any

func (*Value) Decode

func (v *Value) Decode(out any, keys ...string) error

func (*Value) DecodeWithConfig

func (v *Value) DecodeWithConfig(dc *DecoderConfig, out any, keys ...string) error

func (*Value) Exists

func (v *Value) Exists(keys ...string) bool

func (*Value) Get

func (v *Value) Get(keys ...string) (any, error)

func (*Value) GetBool

func (v *Value) GetBool(strict bool, keys ...string) (bool, error)

func (*Value) GetDuration

func (v *Value) GetDuration(strict bool, keys ...string) (time.Duration, error)

func (*Value) GetInt

func (v *Value) GetInt(strict bool, keys ...string) (int, error)

func (*Value) GetString

func (v *Value) GetString(strict bool, keys ...string) (string, error)

func (*Value) Merge

func (v *Value) Merge(in map[string]any) error

func (*Value) Set

func (v *Value) Set(value any, keys ...string)

Jump to

Keyboard shortcuts

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