// Copyright 2014 The Gogs Authors. All rights reserved.// Use of this source code is governed by a MIT-style// license that can be found in the LICENSE file.packageauthimport("net/http""reflect""github.com/go-martini/martini""github.com/gogits/gogs/modules/base""github.com/gogits/gogs/modules/middleware/binding")typeAddSSHKeyFormstruct{KeyNamestring`form:"keyname" binding:"Required"`KeyContentstring`form:"key_content" binding:"Required"`}func(f*AddSSHKeyForm)Name(fieldstring)string{names:=map[string]string{"KeyName":"SSH key name","KeyContent":"SSH key content",}returnnames[field]}func(f*AddSSHKeyForm)Validate(errors*binding.Errors,req*http.Request,contextmartini.Context){data:=context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)validate(errors,data,f)}