feat: implement codec

This commit is contained in:
kairee committed 2022-04-22 20:51:31 +08:00
1 parent 9083504cfc
commit cf8fa335a6
9 files changed
+332

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package client
import "krwu.top/krpc.v1/codec"
type Options struct {
MagicNumber int
CodecType codec.Type
}
var DefaultOptions = &Options{
MagicNumber: codec.MagicNumber,
CodecType: codec.GobType,
}
type Option func(*Options)
func WithCodecType(t codec.Type) Option {
return func(o *Options) {
o.CodecType = t
}
}