20 lines
340 B
Go
20 lines
340 B
Go
package response
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
)
|
|
|
|
type ErrorResponseData struct {
|
|
Code string `json:"code"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type ErrorResponse struct {
|
|
Error ErrorResponseData `json:"error"`
|
|
}
|
|
|
|
func setDefaultHeaders(ctx context.Context, headers http.Header) {
|
|
headers.Set("Content-Type", "application/json")
|
|
}
|