Documentation
¶
Index ¶
- Constants
- Variables
- func ReadAny(in io.Reader) (any, error)
- func ReadArray(in io.Reader, readLength func(indefinite bool, length uint64) error, ...) error
- func ReadBool(in io.Reader) (bool, error)
- func ReadBytes(in io.Reader, readLength func(indefinite bool, length uint64) error, ...) error
- func ReadFloat[T float32 | float64](in io.Reader) (T, error)
- func ReadMap(in io.Reader, readLength func(indefinite bool, length uint64) error, ...) error
- func ReadOver(in io.Reader) error
- func ReadRaw(in io.Reader, out io.Writer) error
- func ReadSigned[T int8 | int16 | int32 | int64](in io.Reader) (T, error)
- func ReadTag(in io.Reader) (uint64, error)
- func ReadUnsigned[T uint8 | uint16 | uint32 | uint64](in io.Reader) (T, error)
- func WriteArrayHeader(out io.Writer, length uint64) (int, error)
- func WriteBool(out io.Writer, value bool) (int, error)
- func WriteBreak(out io.Writer) (int, error)
- func WriteBytes(out io.Writer, value []byte) (int, error)
- func WriteFloat[T float16.Float16 | float32 | float64](out io.Writer, value T) (int, error)
- func WriteMapHeader(out io.Writer, length uint64) (int, error)
- func WriteNull(out io.Writer) (int, error)
- func WriteSigned[T int8 | int16 | int32 | int64](out io.Writer, value T) (int, error)
- func WriteString(out io.Writer, value string) (int, error)
- func WriteTag(out io.Writer, value uint64) (int, error)
- func WriteUnsigned[T uint8 | uint16 | uint32 | uint64](out io.Writer, value T) (int, error)
- type Arg
- type MajorType
Constants ¶
View Source
const ( SimpleFalse Arg = 20 SimpleTrue Arg = 21 SimpleNull Arg = 22 SimpleUndefined Arg = 23 SimpleUint8 = Arg8 // 24 SimpleFloat16 = Arg16 // 25 SimpleFloat32 = Arg32 // 26 SimpleFloat64 = Arg64 // 27 // 28..30 reserved SimpleBreak Arg = 31 )
View Source
const (
MajorTypeMask byte = 0b111_00000
)
Variables ¶
View Source
var ( ErrUnsupportedMajorType = errors.New("cbor: unsupported major type") ErrUnsupportedValue = errors.New("cbor: unsupported value") ErrNotWellFormed = errors.New("cbor: not well formed") ErrOverflow = errors.New("cbor: overflow") ErrNestedIndefinite = errors.New("cbor: nested indefinite") )
Functions ¶
func ReadAny ¶
ReadAny returns the next object form [in] regardless of type. Outputs can be any of int64, uint64, bool, []byte, string, []any, map[any]any, float32, float64, nil.
func WriteFloat ¶
func WriteSigned ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.