增加yaml文件的序列化与反序列化

This commit is contained in:
2024-10-23 17:25:10 +08:00
parent 454b1e8ac6
commit 82ce67170a
5 changed files with 108 additions and 11 deletions

View File

@ -28,7 +28,9 @@ type Serializable interface {
// UnmarshalWithNumberForStringIgnoreError 序列化字符串反解析为结构体,并忽略异常
UnmarshalWithNumberForStringIgnoreError(input string, receiver any)
// MarshalForByte 序列化为字节数组
MarshalForByte(input any) []byte
MarshalForByte(input any) ([]byte, error)
MarshalForByteIgnoreError(input any) []byte
// MarshalForString 序列化为字符串
MarshalForString(input any) string
MarshalForString(input any) (string, error)
MarshalForStringIgnoreError(input any) string
}