github.com/night-codes/go-json@v0.9.15/internal/encoder/option.go (about) 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 } 27 28 type EncodeFormat struct { 29 Header string 30 Footer string 31 } 32 33 type EncodeFormatScheme struct { 34 Int EncodeFormat 35 Uint EncodeFormat 36 Float EncodeFormat 37 Bool EncodeFormat 38 String EncodeFormat 39 Binary EncodeFormat 40 ObjectKey EncodeFormat 41 Null EncodeFormat 42 } 43 44 type ( 45 ColorScheme = EncodeFormatScheme 46 ColorFormat = EncodeFormat 47 )