github.com/hernad/nomad@v1.6.112/nomad/structs/handlers.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package structs
     5  
     6  import (
     7  	"github.com/hashicorp/go-msgpack/codec"
     8  )
     9  
    10  var (
    11  	// JsonHandle and JsonHandlePretty are the codec handles to JSON encode
    12  	// structs. The pretty handle will add indents for easier human consumption.
    13  	// JsonHandleWithExtensions and JsonHandlePretty include extensions for
    14  	// encoding structs objects with API-specific fields
    15  	JsonHandle = &codec.JsonHandle{
    16  		HTMLCharsAsIs: true,
    17  	}
    18  	JsonHandleWithExtensions = NomadJsonEncodingExtensions(&codec.JsonHandle{
    19  		HTMLCharsAsIs: true,
    20  	})
    21  	JsonHandlePretty = NomadJsonEncodingExtensions(&codec.JsonHandle{
    22  		HTMLCharsAsIs: true,
    23  		Indent:        4,
    24  	})
    25  )