2021-04-02 13:31:10 +00:00
|
|
|
package structs
|
2021-03-22 14:12:42 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/go-msgpack/codec"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
// JsonHandle and JsonHandlePretty are the codec handles to JSON encode
|
|
|
|
// structs. The pretty handle will add indents for easier human consumption.
|
|
|
|
// JsonHandleWithExtensions and JsonHandlePretty include extensions for
|
|
|
|
// encoding structs objects with API-specific fields
|
|
|
|
JsonHandle = &codec.JsonHandle{
|
|
|
|
HTMLCharsAsIs: true,
|
|
|
|
}
|
2021-03-26 17:03:15 +00:00
|
|
|
JsonHandleWithExtensions = NomadJsonEncodingExtensions(&codec.JsonHandle{
|
2021-03-22 14:12:42 +00:00
|
|
|
HTMLCharsAsIs: true,
|
|
|
|
})
|
2021-03-26 17:03:15 +00:00
|
|
|
JsonHandlePretty = NomadJsonEncodingExtensions(&codec.JsonHandle{
|
2021-03-22 14:12:42 +00:00
|
|
|
HTMLCharsAsIs: true,
|
|
|
|
Indent: 4,
|
|
|
|
})
|
|
|
|
)
|