func NoCompact() Option {
	return func(o *encOpts) { o.flags.set(noCompact) }
}
NoCompact configures an encoder to disable
the compaction of the JSON output produced
by a call to MarshalJSON, or the content of
a json.RawMessage.
see https://golang.org/pkg/encoding/json/#Compact
package jettison
import (
	"context"
	"fmt"
	"time"
)
const defaultTimeLayout = time.RFC3339Nano
const defaultDurationFmt = DurationNanoseconds
type Option func(*encOpts)
type bitmask uint64
func (b *bitmask) set(f bitmask)     { *b |= f }
func (b bitmask) has(f bitmask) bool { return b&f != 0 }
const (
	unixTime bitmask = 1 << iota
	unsortedMap
	rawByteSlice
	byteArrayAsString
	nilMapEmpty
	nilSliceEmpty
	noStringEscaping
	noHTMLEscaping
	noUTF8Coercion
	noCompact
	noNumberValidation
)
type encOpts struct {
	ctx         context.Context
	timeLayout  string
	durationFmt DurationFmt
	flags       bitmask
	allowList   stringSet
	denyList    stringSet
}
func defaultEncOpts() encOpts {
	return encOpts{
		ctx:         context.TODO(),
		timeLayout:  defaultTimeLayout,
		durationFmt: defaultDurationFmt,
	}
}
func (eo *encOpts) apply(opts ...Option) {
	for _, opt := range opts {
		if opt != nil {
			opt(eo)
		}
	}
}
func (eo encOpts) validate() error {
	switch {
	case eo.ctx == nil:
		return fmt.Errorf("nil context")
	case eo.timeLayout == "":
		return fmt.Errorf("empty time layout")
	case !eo.durationFmt.valid():
		return fmt.Errorf("unknown duration format")
	default:
		return nil
	}
}
func (eo encOpts) isDeniedField(name string) bool {
	if eo.denyList != nil {
		if _, ok := eo.denyList[name]; ok {
			return true
		}
	}
	if eo.allowList != nil {
		if _, ok := eo.allowList[name]; !ok {
			return true
		}
	}
	return false
}
type stringSet map[string]struct{}
func fieldListToSet(list []string) stringSet {
	m := make(stringSet)
	for _, f := range list {
		m[f] = struct{}{}
	}
	return m
}
func UnixTime() Option {
	return func(o *encOpts) { o.flags.set(unixTime) }
}
func UnsortedMap() Option {
	return func(o *encOpts) { o.flags.set(unsortedMap) }
}
func RawByteSlice() Option {
	return func(o *encOpts) { o.flags.set(rawByteSlice) }
}
func ByteArrayAsString() Option {
	return func(o *encOpts) { o.flags.set(byteArrayAsString) }
}
func NilMapEmpty() Option {
	return func(o *encOpts) { o.flags.set(nilMapEmpty) }
}
func NilSliceEmpty() Option {
	return func(o *encOpts) { o.flags.set(nilSliceEmpty) }
}
func NoStringEscaping() Option {
	return func(o *encOpts) { o.flags.set(noStringEscaping) }
}
func NoHTMLEscaping() Option {
	return func(o *encOpts) { o.flags.set(noHTMLEscaping) }
}
func NoUTF8Coercion() Option {
	return func(o *encOpts) { o.flags.set(noUTF8Coercion) }
}
func NoNumberValidation() Option {
	return func(o *encOpts) { o.flags.set(noNumberValidation) }
}