package direct
import "k8s.io/apimachinery/pkg/runtime/serializer/cbor/direct"
Package direct provides functions for marshaling and unmarshaling between arbitrary Go values and CBOR data, with behavior that is compatible with that of the CBOR serializer. In particular, types that implement cbor.Marshaler and cbor.Unmarshaler should use these functions.
Index ¶
- func Diagnose(src []byte) (string, error)
- func Marshal(src any) ([]byte, error)
- func Unmarshal(src []byte, dst any) error
Functions ¶
func Diagnose ¶
Diagnose accepts well-formed CBOR bytes and returns a string representing the same data item in human-readable diagnostic notation (RFC 8949 Section 8). The diagnostic notation is not meant to be parsed.
func Marshal ¶
Marshal serializes a value to CBOR. If there is more than one way to encode the value, it will make the same choice as the CBOR implementation of runtime.Serializer.
func Unmarshal ¶
Unmarshal deserializes from CBOR into an addressable value. If there is more than one way to unmarshal a value, it will make the same choice as the CBOR implementation of runtime.Serializer.
Source Files ¶
direct.go
- Version
- v0.34.2
- Published
- Aug 16, 2025
- Platform
- js/wasm
- Imports
- 1 packages
- Last checked
- 14 minutes ago –
Tools for package owners.