github.com/3JoB/go-json@v0.10.4/internal/encoder/option.go (about)

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