-
Notifications
You must be signed in to change notification settings - Fork 1
/
message.go
46 lines (39 loc) · 1.34 KB
/
message.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
package eventstream
import "github.com/geniusrabbit/eventstream/internal/message"
type unmarshalel interface {
Unmarshal(data []byte, v any) error
}
var EmptyMessage = message.EmptyMessage
type (
Formater = message.Formater
FieldType = message.FieldType
Message = message.Message
MapMessage = message.MapMessage
)
// Field scalar types enum
const (
FieldTypeString = message.FieldTypeString
FieldTypeFixed = message.FieldTypeFixed
FieldTypeUUID = message.FieldTypeUUID
FieldTypeInt = message.FieldTypeInt
FieldTypeInt32 = message.FieldTypeInt32
FieldTypeInt8 = message.FieldTypeInt8
FieldTypeUint = message.FieldTypeUint
FieldTypeUint32 = message.FieldTypeUint32
FieldTypeUint8 = message.FieldTypeUint8
FieldTypeFloat = message.FieldTypeFloat
FieldTypeBoolean = message.FieldTypeBoolean
FieldTypeIP = message.FieldTypeIP
FieldTypeDate = message.FieldTypeDate
FieldTypeUnixnano = message.FieldTypeUnixnano
FieldTypeArrayInt32 = message.FieldTypeArrayInt32
FieldTypeArrayInt64 = message.FieldTypeArrayInt64
)
// TypeByString name
func TypeByString(t string) FieldType {
return message.TypeByString(t)
}
// MessageDecode from bytes
func MessageDecode(data []byte, converter unmarshalel) (msg Message, err error) {
return message.MapMessageDecode(data, converter)
}