From 025f9d74cecd5b54ee136503e8fc567a37685686 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Mon, 18 Sep 2023 22:05:30 -0400 Subject: [PATCH] =?UTF-8?q?Migrer=20responses=20=C3=A0=20voki/response?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- responses/health.go | 4 +++- responses/post.go | 6 ++++-- responses/root.go | 15 --------------- 3 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 responses/root.go diff --git a/responses/health.go b/responses/health.go index 854279d..1edf34a 100644 --- a/responses/health.go +++ b/responses/health.go @@ -1,5 +1,7 @@ package responses +import "codeberg.org/vlbeaudoin/voki/response" + type GetHealthResponse struct { - Response + response.ResponseWithError } diff --git a/responses/post.go b/responses/post.go index 91eef96..cfb03af 100644 --- a/responses/post.go +++ b/responses/post.go @@ -1,14 +1,16 @@ package responses +import "codeberg.org/vlbeaudoin/voki/response" + type PostMembresResponse struct { - Response + response.ResponseWithError Data struct { MembresInserted int64 } } type PostProgrammesResponse struct { - Response + response.ResponseWithError Data struct { ProgrammesInserted int64 } diff --git a/responses/root.go b/responses/root.go deleted file mode 100644 index 0f0bcce..0000000 --- a/responses/root.go +++ /dev/null @@ -1,15 +0,0 @@ -package responses - -type Response struct { - StatusCode int - Message string - Error string -} - -type Responder interface { - Respond() Responder -} - -func (r Response) Respond() Responder { - return r -}