conf

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	// 将对象转成string时是否支持使用对象实现的String方法
	CvtStrUseStringMethod bool
	// 参考ToMapType接口方法,将对象转成map[x]y类型时,是否忽略转换失败的情况,如:转成map[int]int类型时,9个转成功,1个转失败时,是返回含9个元素的map还是返回错误;
	SkipCvtFailForToMapType bool
	// 参考ToArrayType接口方法,将对象转成[]int类型时,是否忽略转换失败的情况,如:[]int类型时,9个转成功,1个转失败时,是返回含9个元素的list还是返回错误;
	SkipCvtFailForToArrayType bool
}
var (
	CONF *Conf
)

func (*Conf) SetCvtStrUseStringMethod

func (c *Conf) SetCvtStrUseStringMethod(b bool) *Conf

SetCvtStrUseStringMethod 将结构体转换成str的时候是否尝试调用String方法,默认:true

func (*Conf) SetLogger

func (c *Conf) SetLogger(log logx.LogItf) *Conf

func (*Conf) SetSkipCvtFailForToArrayType

func (c *Conf) SetSkipCvtFailForToArrayType(b bool) *Conf

SetSkipCvtFailForToArrayType ToArrayType接口转换中,是否跳过部分转换失败的情况,默认:false

func (*Conf) SetSkipCvtFailForToMapType

func (c *Conf) SetSkipCvtFailForToMapType(b bool) *Conf

SetSkipCvtFailForToMapType ToMapType接口转换中,是否跳过部分转换失败的情况,默认:false

Jump to

Keyboard shortcuts

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