module

Mangrullo::JsonResponseHelper

Helper module for standardizing JSON responses in the web server

Class methods

send_container_response(env, container_id : String, success : Bool, message : String | Nil = nil)

Send a container update response

Source
send_error(env, message : String, status_code : Int32 = 500, details = nil)

Send an error JSON response

Source
send_job_response(env, job_id : String, container_id : String, status : String, message : String)

Send a JSON response with a job ID

Source
send_paginated(env, data : Array, total : Int32, page : Int32, per_page : Int32)

Send a paginated response

Source
send_status(env, status : String, message : String | Nil = nil)

Send a status response

Source
send_success(env, data = nil)

Send a successful JSON response

Source