reflect

package
v0.1.931 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	contract.ReflectOperator
}

func NewClient

func NewClient() Client

type DefaultTool added in v0.1.11

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool

func (*DefaultTool) FillNilPointers added in v0.1.11

func (d *DefaultTool) FillNilPointers(ctx context.Context, to, from any) error

FillNilPointers replaces nil pointer fields in the target struct with values from the source struct.

Key Principles: - Only nil pointers in to will be replaced by the corresponding values from from. - Deep copying prevents the structs from sharing underlying data references. - Non-nil fields remain untouched in to. - Unexported fields will be skipped. - Supports nested struct pointers with recursive handling. - Prevents panic for non-struct primitive types.

Supported Input Combinations: - to and from can be:

  • An interface holding a struct directly.
  • An interface holding a pointer to a struct.
  • A pointer to a struct directly.
  • A struct directly.

type Tool added in v0.1.245

type Tool interface {
	Client
}

Jump to

Keyboard shortcuts

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