Bumps [github.com/shamaton/msgpack/v2](https://github.com/shamaton/msgpack) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/shamaton/msgpack/releases) - [Commits](https://github.com/shamaton/msgpack/compare/v2.3.0...v2.3.1) --- updated-dependencies: - dependency-name: github.com/shamaton/msgpack/v2 dependency-version: 2.3.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
23 lines
816 B
Go
23 lines
816 B
Go
package ext
|
|
|
|
import (
|
|
"reflect"
|
|
)
|
|
|
|
// StreamDecoder defines an interface for decoding streams of data.
|
|
// It provides methods to retrieve the decoder's code, check type compatibility,
|
|
// and convert raw data into a Go value of a specified kind.
|
|
type StreamDecoder interface {
|
|
// Code returns the unique identifier for the decoder.
|
|
Code() int8
|
|
|
|
// IsType checks if the provided code, inner type, and data length match the expected type.
|
|
// Returns true if the type matches, otherwise false.
|
|
IsType(code byte, innerType int8, dataLength int) bool
|
|
|
|
// ToValue converts the raw data into a Go value of the specified kind.
|
|
// Takes the code, raw data, and the target kind as input.
|
|
// Returns the decoded value or an error if the conversion fails.
|
|
ToValue(code byte, data []byte, k reflect.Kind) (any, error)
|
|
}
|