aboutsummaryrefslogtreecommitdiff
path: root/lib/http/callback.go
AgeCommit message (Collapse)Author
2026-01-15all: convert license and copyright to use SPDX identifiersShulhan
With help of spdxconv tool [1], we able to bulk update all files license and copyright format to comply with SPDX formats. [1] https://kilabit.info/project/spdxconv/
2024-01-24lib/http: update doc to use comment linksShulhan
2023-11-22lib/http: update comment on Callback typeShulhan
2022-05-09all: reformat all codes using gofmt 1.19 (the Go tip)Shulhan
2021-03-04http: refactoring parameters on Callback and CallbackErrorHandlerShulhan
Previously, the parameters to Callback has three types: the http.ResponseWriter, *http.Request, and []byte for response body. Not only the type names are long, there is no information on the registered Endpoint on the receiver of Callback. This changes wrap the three parameters into single type EndpointRequest with addition field Endpoint, which contains the registered Endpoint. On the CallbackErrorHandler we also have three parameters, but instead of request body we have an error. This changes store the error for CallbackErrorHandler inside EndpointRequest.Error field.
2019-01-05lib/http: add parameter http.ResponseWriter to CallbackShulhan
The ResponseWriter can be used to write custom header or to write cookies.
2018-12-16lib/http: add custom error type for callbackShulhan
Custom error "StatusError" can be used by user to return an error with status code and message.
2018-12-16lib/http: new package for simplifying writing HTTP serverShulhan