func (t Tristate) MarshalJSON() ([]byte, error) {
	switch t {
	case TristateOff:
		return []byte("false"), nil
	case TristateOn:
		return []byte("true"), nil
	case TristateAuto:
		return []byte("\"auto\""), nil
	}
	return nil, policyError("invalid tristate value %v", t)
}
MarshalJSON implements the marshaller function for "encoding/json"
package static
import (
	"github.com/intel/cri-resource-manager/pkg/config"
	"sigs.k8s.io/yaml"
)
type options struct {
	RelaxedIsolation bool `json:"RelaxedIsolation"`
	Rdt Tristate `json:"Rdt"`
}
type Tristate int
const (
	TristateOff = iota
	TristateOn
	TristateAuto
)
var opt = defaultOptions().(*options)
func (t *Tristate) UnmarshalJSON(data []byte) error {
	var value interface{}
	if err := yaml.Unmarshal(data, &value); err != nil {
		return policyError("invalid Tristate value '%s': %v", string(data), err)
	}
	switch value.(type) {
	case bool:
		*t = map[bool]Tristate{false: TristateOff, true: TristateOn}[value.(bool)]
		return nil
	case string:
		if value.(string) == "auto" {
			*t = TristateAuto
			return nil
		}
	}
	return policyError("invalid Tristate value %v of type %T", value, value)
}