func respondJSON()

in src/local_gpu_verifier_http_service/cmd/local_gpu_verifier_http_service/main.go [295:308]


func respondJSON(w http.ResponseWriter, statusCode int, attestationOutput string, token interface{}) {
	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(statusCode)

	resp := map[string]interface{}{
		"attestation_output":       attestationOutput,
		"entity_attestation_token": token,
	}
	enc := json.NewEncoder(w)
	enc.SetIndent("", "  ")
	if err := enc.Encode(resp); err != nil {
		logger.Error("Error encoding JSON response", "error", err)
	}
}