app

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetType

func GetType[T any](d DataMap, key string) (T, bool)

Get any type from the datamap. Panics if the type is not correct. Returns a new instance of the type if the key is not found.

Types

type DataMap

type DataMap map[string]any

Application datamap to store and retrieve data.

func (DataMap) Get

func (d DataMap) Get(key string) interface{}

Get data from the data map.

func (DataMap) GetBool

func (d DataMap) GetBool(key string) bool

Get data from the data map in the form of a bool.

func (DataMap) GetBytes

func (d DataMap) GetBytes(key string) []byte

Get data from the data map in the form of a []byte.

func (DataMap) GetComplex

func (d DataMap) GetComplex(key string) complex128

Get data from the data map in the form of a complex128.

func (DataMap) GetDuration

func (d DataMap) GetDuration(key string) time.Duration

Get data from the data map in the form of a time.Duration.

func (DataMap) GetFloat

func (d DataMap) GetFloat(key string) float64

Get data from the data map in the form of a float64.

func (DataMap) GetInt

func (d DataMap) GetInt(key string) int

Get data from the data map in the form of an int.

func (DataMap) GetRunes

func (d DataMap) GetRunes(key string) []rune

Get data from the data map in the form of a []rune.

func (DataMap) GetString

func (d DataMap) GetString(key string) string

Get data from the data map in the form of a string.

func (DataMap) GetTime

func (d DataMap) GetTime(key string) time.Time

Get data from the data map in the form of a time.Time.

func (DataMap) GetUint

func (d DataMap) GetUint(key string) uint

Get data from the data map in the form of a uint.

func (DataMap) Set

func (d DataMap) Set(k string, v any)

Set data on the data map.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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