-
Notifications
You must be signed in to change notification settings - Fork 2
/
interfaces.go
80 lines (77 loc) · 2.24 KB
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package msgpack
import (
"time"
)
// Reader is the interface for reading data from the MessagePack format.
type Reader interface {
IsNextNil() (bool, error)
ReadBool() (bool, error)
ReadNillableBool() (*bool, error)
ReadInt8() (int8, error)
ReadNillableInt8() (*int8, error)
ReadInt16() (int16, error)
ReadNillableInt16() (*int16, error)
ReadInt32() (int32, error)
ReadNillableInt32() (*int32, error)
ReadInt64() (int64, error)
ReadNillableInt64() (*int64, error)
ReadUint8() (uint8, error)
ReadNillableUint8() (*uint8, error)
ReadUint16() (uint16, error)
ReadNillableUint16() (*uint16, error)
ReadUint32() (uint32, error)
ReadNillableUint32() (*uint32, error)
ReadUint64() (uint64, error)
ReadNillableUint64() (*uint64, error)
ReadFloat32() (float32, error)
ReadNillableFloat32() (*float32, error)
ReadFloat64() (float64, error)
ReadNillableFloat64() (*float64, error)
ReadString() (string, error)
ReadNillableString() (*string, error)
ReadTime() (time.Time, error)
ReadNillableTime() (*time.Time, error)
ReadByteArray() ([]byte, error)
ReadNillableByteArray() ([]byte, error)
ReadArraySize() (uint32, error)
ReadMapSize() (uint32, error)
ReadAny() (any, error)
Skip() error
Err() error
}
// Writer is the interface for writing data to the MessagePack format.
type Writer interface {
WriteNil()
WriteBool(value bool)
WriteNillableBool(value *bool)
WriteInt8(value int8)
WriteNillableInt8(value *int8)
WriteInt16(value int16)
WriteNillableInt16(value *int16)
WriteInt32(value int32)
WriteNillableInt32(value *int32)
WriteInt64(value int64)
WriteNillableInt64(value *int64)
WriteUint8(value uint8)
WriteNillableUint8(value *uint8)
WriteUint16(value uint16)
WriteNillableUint16(value *uint16)
WriteUint32(value uint32)
WriteNillableUint32(value *uint32)
WriteUint64(value uint64)
WriteNillableUint64(value *uint64)
WriteFloat32(value float32)
WriteNillableFloat32(value *float32)
WriteFloat64(value float64)
WriteNillableFloat64(value *float64)
WriteString(value string)
WriteNillableString(value *string)
WriteTime(value time.Time)
WriteNillableTime(value *time.Time)
WriteByteArray(value []byte)
WriteNillableByteArray(value []byte)
WriteArraySize(length uint32)
WriteMapSize(length uint32)
WriteAny(value any)
Err() error
}