選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

repo_tag_form.go 671B

1234567891011121314151617181920212223242526
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package forms
  4. import (
  5. "net/http"
  6. "code.gitea.io/gitea/modules/web/middleware"
  7. "code.gitea.io/gitea/services/context"
  8. "gitea.com/go-chi/binding"
  9. )
  10. // ProtectTagForm form for changing protected tag settings
  11. type ProtectTagForm struct {
  12. NamePattern string `binding:"Required;GlobOrRegexPattern"`
  13. AllowlistUsers string
  14. AllowlistTeams string
  15. }
  16. // Validate validates the fields
  17. func (f *ProtectTagForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
  18. ctx := context.GetValidateContext(req)
  19. return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
  20. }