utils

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package utils provides general utility functions for A2A.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeepCopy

func DeepCopy[T any](task *T) (*T, error)

DeepCopy uses gob encode-decode pass to create a deep-copy of the referenced data.

func FromMapStruct added in v2.3.0

func FromMapStruct[T any](value map[string]any) (*T, error)

FromMapStruct converts map[string]any to a typed value using json roundtrip.

func MustPrettyPrint added in v2.3.0

func MustPrettyPrint(value any)

MustPrettyPrint is a debugging utility that prints indented JSON represenation of a value.

func Ptr

func Ptr[T any](v T) *T

Ptr returns a pointer to the argument simplifying pointer to primitive literals creation.

func ToMapStruct added in v2.3.0

func ToMapStruct(value any) (map[string]any, error)

ToMapStruct converts an any struct to map[string]any using json roundtrip.

func ToStringMap added in v2.2.1

func ToStringMap(raw any) (map[string]string, bool)

ToStringMap converts a map[string]any to a map[string]string. It logs a warning if a value cannot be converted to a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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