publickey_form.go 534 B

12345678910111213141516171819
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package auth
  5. import (
  6. "github.com/Unknwon/macaron"
  7. "github.com/macaron-contrib/binding"
  8. )
  9. type AddSSHKeyForm struct {
  10. SSHTitle string `form:"title" binding:"Required"`
  11. Content string `form:"content" binding:"Required"`
  12. }
  13. func (f *AddSSHKeyForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  14. return validate(errs, ctx.Data, f, ctx.Locale)
  15. }