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

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