github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/nomad/structs/handlers.go (about)

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