Files
bl/common/serialize/sturc/custom.go
昔念 cc9f1fb45a refactor(info): 删除多余的信息结构体文件
- 移除了多个未使用的 Java 和 Go 信息结构体文件
- 优化了项目结构,减少了冗余代码
- 这些文件可能是早期开发阶段的遗留代码,现在已不再需要
2025-06-23 10:15:22 +08:00

34 lines
668 B
Go

package struc
import (
"io"
"reflect"
)
type Custom interface {
Pack(p []byte, opt *Options) (int, error)
Unpack(r io.Reader, length int, opt *Options) error
Size(opt *Options) int
String() string
}
type customFallback struct {
custom Custom
}
func (c customFallback) Pack(p []byte, val reflect.Value, opt *Options) (int, error) {
return c.custom.Pack(p, opt)
}
func (c customFallback) Unpack(r io.Reader, val reflect.Value, opt *Options) error {
return c.custom.Unpack(r, 1, opt)
}
func (c customFallback) Sizeof(val reflect.Value, opt *Options) int {
return c.custom.Size(opt)
}
func (c customFallback) String() string {
return c.custom.String()
}