github.com/minio/console@v1.4.1/api/operations/public/download_shared_object.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // This file is part of MinIO Console Server 4 // Copyright (c) 2023 MinIO, Inc. 5 // 6 // This program is free software: you can redistribute it and/or modify 7 // it under the terms of the GNU Affero General Public License as published by 8 // the Free Software Foundation, either version 3 of the License, or 9 // (at your option) any later version. 10 // 11 // This program is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU Affero General Public License for more details. 15 // 16 // You should have received a copy of the GNU Affero General Public License 17 // along with this program. If not, see <http://www.gnu.org/licenses/>. 18 // 19 20 package public 21 22 // This file was generated by the swagger tool. 23 // Editing this file might prove futile when you re-run the generate command 24 25 import ( 26 "net/http" 27 28 "github.com/go-openapi/runtime/middleware" 29 ) 30 31 // DownloadSharedObjectHandlerFunc turns a function with the right signature into a download shared object handler 32 type DownloadSharedObjectHandlerFunc func(DownloadSharedObjectParams) middleware.Responder 33 34 // Handle executing the request and returning a response 35 func (fn DownloadSharedObjectHandlerFunc) Handle(params DownloadSharedObjectParams) middleware.Responder { 36 return fn(params) 37 } 38 39 // DownloadSharedObjectHandler interface for that can handle valid download shared object params 40 type DownloadSharedObjectHandler interface { 41 Handle(DownloadSharedObjectParams) middleware.Responder 42 } 43 44 // NewDownloadSharedObject creates a new http.Handler for the download shared object operation 45 func NewDownloadSharedObject(ctx *middleware.Context, handler DownloadSharedObjectHandler) *DownloadSharedObject { 46 return &DownloadSharedObject{Context: ctx, Handler: handler} 47 } 48 49 /* 50 DownloadSharedObject swagger:route GET /download-shared-object/{url} Public downloadSharedObject 51 52 Downloads an object from a presigned url 53 */ 54 type DownloadSharedObject struct { 55 Context *middleware.Context 56 Handler DownloadSharedObjectHandler 57 } 58 59 func (o *DownloadSharedObject) ServeHTTP(rw http.ResponseWriter, r *http.Request) { 60 route, rCtx, _ := o.Context.RouteInfo(r) 61 if rCtx != nil { 62 *r = *rCtx 63 } 64 var Params = NewDownloadSharedObjectParams() 65 if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params 66 o.Context.Respond(rw, r, route.Produces, route, err) 67 return 68 } 69 70 res := o.Handler.Handle(Params) // actually handle the request 71 o.Context.Respond(rw, r, route.Produces, route, res) 72 73 }