feat: implement codec
This commit is contained in:
21
client/option.go
Normal file
21
client/option.go
Normal 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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user