github.com/minio/console@v1.4.1/api/operations/auth/login_detail.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 auth 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 // LoginDetailHandlerFunc turns a function with the right signature into a login detail handler 32 type LoginDetailHandlerFunc func(LoginDetailParams) middleware.Responder 33 34 // Handle executing the request and returning a response 35 func (fn LoginDetailHandlerFunc) Handle(params LoginDetailParams) middleware.Responder { 36 return fn(params) 37 } 38 39 // LoginDetailHandler interface for that can handle valid login detail params 40 type LoginDetailHandler interface { 41 Handle(LoginDetailParams) middleware.Responder 42 } 43 44 // NewLoginDetail creates a new http.Handler for the login detail operation 45 func NewLoginDetail(ctx *middleware.Context, handler LoginDetailHandler) *LoginDetail { 46 return &LoginDetail{Context: ctx, Handler: handler} 47 } 48 49 /* 50 LoginDetail swagger:route GET /login Auth loginDetail 51 52 Returns login strategy, form or sso. 53 */ 54 type LoginDetail struct { 55 Context *middleware.Context 56 Handler LoginDetailHandler 57 } 58 59 func (o *LoginDetail) 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 = NewLoginDetailParams() 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 }