option.go 723 B

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