-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: 彭锟 <[email protected]>
- Loading branch information
Showing
7 changed files
with
195 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
*.dll | ||
*.so | ||
*.dylib | ||
.DS_Store | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
package core | ||
|
||
import ( | ||
"reflect" | ||
) | ||
|
||
func RegisterType(name string, id any) error { | ||
val := reflect.ValueOf(id) | ||
typ := val.Type() | ||
if err := globalProvider.setBidNameType(name, typ); err != nil { | ||
return err | ||
} | ||
return nil | ||
return globalProvider.RegisterType(name, id) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,9 @@ | ||
package core | ||
|
||
import ( | ||
"reflect" | ||
|
||
"github.com/vmihailenco/msgpack/v5" | ||
) | ||
|
||
func MarshalMsgPack(in any) ([]byte, error) { | ||
outIf, err := shuttleMarshal(in) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return msgpack.Marshal(outIf) | ||
return globalProvider.MarshalMsgPack(in) | ||
} | ||
|
||
func UnmarshalMsgPack(out any, b []byte) error { | ||
return shuttleUnmarshal(out, func(a any, inType, outTyp reflect.Type) error { | ||
return msgpack.Unmarshal(b, a) | ||
}) | ||
|
||
return globalProvider.UnmarshalMsgPack(out, b) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.