code.gitea.io/gitea@v1.21.7/services/forms/runner.go (about)

     1  // Copyright 2022 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package forms
     5  
     6  import (
     7  	"net/http"
     8  
     9  	"code.gitea.io/gitea/modules/context"
    10  	"code.gitea.io/gitea/modules/web/middleware"
    11  
    12  	"gitea.com/go-chi/binding"
    13  )
    14  
    15  // EditRunnerForm form for admin to create runner
    16  type EditRunnerForm struct {
    17  	Description string
    18  }
    19  
    20  // Validate validates form fields
    21  func (f *EditRunnerForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
    22  	ctx := context.GetValidateContext(req)
    23  	return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
    24  }