You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
650 B
42 lines
650 B
3 years ago
|
package encoder
|
||
|
|
||
|
import "context"
|
||
|
|
||
|
type OptionFlag uint8
|
||
|
|
||
|
const (
|
||
|
HTMLEscapeOption OptionFlag = 1 << iota
|
||
|
IndentOption
|
||
|
UnorderedMapOption
|
||
|
DebugOption
|
||
|
ColorizeOption
|
||
|
ContextOption
|
||
|
)
|
||
|
|
||
|
type Option struct {
|
||
|
Flag OptionFlag
|
||
|
ColorScheme *ColorScheme
|
||
|
Context context.Context
|
||
|
}
|
||
|
|
||
|
type EncodeFormat struct {
|
||
|
Header string
|
||
|
Footer string
|
||
|
}
|
||
|
|
||
|
type EncodeFormatScheme struct {
|
||
|
Int EncodeFormat
|
||
|
Uint EncodeFormat
|
||
|
Float EncodeFormat
|
||
|
Bool EncodeFormat
|
||
|
String EncodeFormat
|
||
|
Binary EncodeFormat
|
||
|
ObjectKey EncodeFormat
|
||
|
Null EncodeFormat
|
||
|
}
|
||
|
|
||
|
type (
|
||
|
ColorScheme = EncodeFormatScheme
|
||
|
ColorFormat = EncodeFormat
|
||
|
)
|