Documentation
¶
Index ¶
- func CopyBean(src interface{}, dest interface{}) error
- func CopyBeanUseJson(src interface{}, dest interface{}) error
- func DefaultBool(v interface{}) (bool, bool)
- func DefaultString(v interface{}) (string, bool)
- func Indirect(t reflect.Type) reflect.Type
- func LoadXmlConfig(path string, config interface{}) error
- func LocalIPv4() string
- func NewList(v ...interface{}) *list.List
- func SafeCloseChan(ch chan struct{})
- func ToJson(i interface{}) string
- func ToString(err error) string
- func ValuePatch(v reflect.Value) reflect.Value
- func ValuePatchIf(v reflect.Value, allAccess bool) reflect.Value
- type PanicCond
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyBean ¶
func CopyBean(src interface{}, dest interface{}) error
CopyBean 使用反射直接赋值的方式拷贝,不支持匿名字段,不支持类型转换。 TODO 完善该方法,可以参考 json 序列化,并且需要进行性能测试。
func CopyBeanUseJson ¶
func CopyBeanUseJson(src interface{}, dest interface{}) error
CopyBeanUseJson 使用 json 序列化框架进行拷贝,支持匿名字段,支持类型转换。
func DefaultBool ¶ added in v1.0.3
DefaultBool 将 nil 转换成 false 布尔值
func DefaultString ¶ added in v1.0.3
DefaultString 将 nil 转换成空字符串
func LoadXmlConfig ¶
LoadXmlConfig 加载 XML 配置文件
func ValuePatch ¶
ValuePatch 开放 Value 的私有字段,但是不会更新外部传入的 Value。
Types ¶
Click to show internal directories.
Click to hide internal directories.