utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assignment

func Assignment(arguments reflect.Value, value interface{}) error

Assignment 递归对单个反射结构体进行赋值 Assignment 带注入的参数,入参必须是值类型,指针类型赋值需要传递指针所指向的value,带注入的参数为map类型时候 arguments发射的map对应的接收类型必须是 map[string]interface{} value对应注入的 k/v

func AssignmentMap

func AssignmentMap(arguments reflect.Value, value map[string]interface{}) error

AssignmentMap 专门针对 map数据类型 进行解析

func Injection

func Injection(field, value reflect.Value) error

Injection 反射初始化 把容器中对应的 value 赋值给 目标结构体的 field 字段

func StarAssignment

func StarAssignment(value reflect.Value, data interface{}) error

StarAssignment data 传入 value 对应的 map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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