From 15e4d10fd4b35a2e70cc4fa6ad4117cd5c402cbc Mon Sep 17 00:00:00 2001 From: Quentin Date: Mon, 23 Aug 2021 20:40:03 +0200 Subject: Refactor the codebase --- middleware.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 middleware.go (limited to 'middleware.go') diff --git a/middleware.go b/middleware.go new file mode 100644 index 0000000..8688347 --- /dev/null +++ b/middleware.go @@ -0,0 +1,17 @@ +package main + +import ( + "github.com/minio/minio-go/v7" + "net/http" +) + +/* We define some interface to enable our middleware to communicate */ +type ErrorHandler interface { + WithError(err error) http.Handler +} +type CredsHandler interface { + WithCreds(username, password string) http.Handler +} +type MinioClientHandler interface { + WithMC(mc *minio.Client) http.Handler +} -- cgit v1.2.3