option.go (751B)
1 package encoder 2 3 import ( 4 "context" 5 "io" 6 ) 7 8 type OptionFlag uint8 9 10 const ( 11 HTMLEscapeOption OptionFlag = 1 << iota 12 IndentOption 13 UnorderedMapOption 14 DebugOption 15 ColorizeOption 16 ContextOption 17 NormalizeUTF8Option 18 FieldQueryOption 19 ) 20 21 type Option struct { 22 Flag OptionFlag 23 ColorScheme *ColorScheme 24 Context context.Context 25 DebugOut io.Writer 26 DebugDOTOut io.WriteCloser 27 } 28 29 type EncodeFormat struct { 30 Header string 31 Footer string 32 } 33 34 type EncodeFormatScheme struct { 35 Int EncodeFormat 36 Uint EncodeFormat 37 Float EncodeFormat 38 Bool EncodeFormat 39 String EncodeFormat 40 Binary EncodeFormat 41 ObjectKey EncodeFormat 42 Null EncodeFormat 43 } 44 45 type ( 46 ColorScheme = EncodeFormatScheme 47 ColorFormat = EncodeFormat 48 )