component

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 6 Imported by: 1

Documentation

Overview

Component helper functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(a []string, x string) bool

Contains tells whether a contains x.

func GetComponentID

func GetComponentID() string

func RandString

func RandString(length int) string

func StringToDateTime

func StringToDateTime(value string) (time.Time, error)

StringToDateTime - parse string to datetime

func TemplateBuilder

func TemplateBuilder(name, tpl string, funcMap map[string]any, data any) (res string, err error)

func ToBoolean

func ToBoolean(value interface{}, defValue bool) bool

ToBoolean - safe bool conversion

func ToFloat

func ToFloat(value interface{}, defValue float64) float64

ToFloat - safe float64 conversion

func ToInteger

func ToInteger(value interface{}, defValue int64) int64

ToInteger - safe int64 conversion

func ToString

func ToString(value interface{}, defValue string) string

ToString - safe string conversion

Types

type IM

type IM = map[string]interface{}

IM is a map[string]interface{} type short alias

func MergeIM

func MergeIM(baseMap, valueMap IM) IM

func SetIMValue

func SetIMValue(imap IM, key string, value interface{}) IM

SetIMValue - safe IM value setting

func ToIMA

func ToIMA(value interface{}, defValue []IM) []IM

type SM

type SM = map[string]string

SM is a map[string]string type short alias

func MergeSM

func MergeSM(baseMap, valueMap SM) SM

func SetSMValue

func SetSMValue(smap SM, key string, value string) SM

SetSMValue - safe SM value setting

Jump to

Keyboard shortcuts

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