utils

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RespondWithError

func RespondWithError(w http.ResponseWriter, statusCode int, errorCode models.ConsentErrorCode, message string)

RespondWithError sends a JSON error response with the given status code This version accepts models.ConsentErrorCode for type-safe error codes

func RespondWithJSON

func RespondWithJSON(w http.ResponseWriter, statusCode int, payload interface{})

RespondWithJSON sends a JSON response with the given status code

Types

type ErrorResponse

type ErrorResponse struct {
	Error struct {
		Code    string `json:"code"`
		Message string `json:"message"`
	} `json:"error"`
}

ErrorResponse represents a standardized error response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL