diff --git a/apiresponse/apiresponse.go b/apiresponse/apiresponse.go index 2114a9b..6f5afe5 100644 --- a/apiresponse/apiresponse.go +++ b/apiresponse/apiresponse.go @@ -1,24 +1,11 @@ // Package apiresponse provides response types for API routes package apiresponse -// Response defines the basic response types fields -type Response struct { - Error string - Message string - StatusCode int -} - -type Responder interface { - Respond() Responder -} - -func (r Response) Respond() Responder { - return r -} +import "codeberg.org/vlbeaudoin/voki/response" // HealthGET is the response type for `GET /v:version/health/ http/1.1` type HealthGET struct { - Response + response.ResponseWithError Data struct { BottinStatus string } @@ -26,7 +13,7 @@ type HealthGET struct { // ScanGET is the response type for `GET /v:version/scan/ http/1.1` type ScanGET struct { - Response + response.ResponseWithError Data struct { IsScanned bool } @@ -34,5 +21,5 @@ type ScanGET struct { // ScanPOST is the response type for `POST /v:version/scan/ http/1.1` type ScanPOST struct { - Response + response.ResponseWithError } diff --git a/go.mod b/go.mod index 946e796..0d9f055 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.agecem.com/agecem/bottin-ag go 1.21.0 require ( - codeberg.org/vlbeaudoin/voki v1.1.2 + codeberg.org/vlbeaudoin/voki v1.2.0 git.agecem.com/agecem/bottin/v5 v5.3.0 github.com/jmoiron/sqlx v1.3.5 github.com/labstack/echo/v4 v4.11.1 diff --git a/go.sum b/go.sum index 6c9a2ed..7419f20 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -codeberg.org/vlbeaudoin/voki v1.1.2 h1:31xCFeJEGxEpe/o3q+l1np8DUbaWq+TVUf+JVyuUxEc= -codeberg.org/vlbeaudoin/voki v1.1.2/go.mod h1:5XTLx/KiW/OfiupF3o7PAAAU/UhsPdKSrVMmtHbmkPI= +codeberg.org/vlbeaudoin/voki v1.2.0 h1:MpbZtKvSpkjnduSlNBVikn8OHQFwH9bEBBhUW9LQW34= +codeberg.org/vlbeaudoin/voki v1.2.0/go.mod h1:5XTLx/KiW/OfiupF3o7PAAAU/UhsPdKSrVMmtHbmkPI= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.agecem.com/agecem/bottin/v5 v5.3.0 h1:7Fb0nJaGbWO2q//nTTZcVqLJoVSw0Ov0IoCs7/6ja+o= git.agecem.com/agecem/bottin/v5 v5.3.0/go.mod h1:r4ZZB7P0XL4ZCatD99LHCS9fkpjl0UFCasalYPEW0Hw= diff --git a/webresponse/webresponse.go b/webresponse/webresponse.go index 8d7491a..b2672b2 100644 --- a/webresponse/webresponse.go +++ b/webresponse/webresponse.go @@ -1,11 +1,11 @@ package webresponse -import "git.agecem.com/agecem/bottin-ag/apiresponse" +import "codeberg.org/vlbeaudoin/voki/response" type IndexGET struct { - apiresponse.Response + response.ResponseWithError } type ScanPOST struct { - apiresponse.Response + response.ResponseWithError }