...
1
2
3 package zerolog
4
5
6
7 import (
8 "github.com/rs/zerolog/internal/cbor"
9 )
10
11 var (
12 _ encoder = (*cbor.Encoder)(nil)
13
14 enc = cbor.Encoder{}
15 )
16
17 func init() {
18
19 cbor.JSONMarshalFunc = func(v interface{}) ([]byte, error) {
20 return InterfaceMarshalFunc(v)
21 }
22 }
23
24 func appendJSON(dst []byte, j []byte) []byte {
25 return cbor.AppendEmbeddedJSON(dst, j)
26 }
27
28
29
30 func decodeIfBinaryToString(in []byte) string {
31 return cbor.DecodeIfBinaryToString(in)
32 }
33
34 func decodeObjectToStr(in []byte) string {
35 return cbor.DecodeObjectToStr(in)
36 }
37
38
39
40 func decodeIfBinaryToBytes(in []byte) []byte {
41 return cbor.DecodeIfBinaryToBytes(in)
42 }
43
View as plain text