basic

package module
v0.81.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package basic contains helpers related to basic types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToDefaultType added in v0.81.0

func ConvertToDefaultType(value, defaultValue interface{}, coerceMaps bool) (interface{}, error)

ConvertToDefaultType casts value to the type of defaultValue. Map types are reshaped only when coerceMaps is true (used for JSON-decoded inputs).

func StructToMap added in v0.81.0

func StructToMap(v interface{}) interface{}

StructToMap recursively converts a struct to map[string]interface{} using mapstructure tags for keys (falling back to field name). This produces only basic types that pass ValidateBasicTypes. Zero-value fields are omitted.

func ValidateBasicTypes

func ValidateBasicTypes(value interface{}) bool

ValidateBasicTypes returns true if the argument is made of only basic types

Types

This section is empty.

Jump to

Keyboard shortcuts

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