You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

cloudbrain.go 913 B

4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526
  1. package auth
  2. import (
  3. "gitea.com/macaron/binding"
  4. "gitea.com/macaron/macaron"
  5. )
  6. type CreateCloudBrainForm struct {
  7. JobName string `form:"job_name" binding:"Required"`
  8. Image string `form:"image" binding:"Required"`
  9. Command string `form:"command" binding:"Required"`
  10. Attachment string `form:"attachment" binding:"Required"`
  11. JobType string `form:"job_type" binding:"Required"`
  12. BenchmarkCategory string `form:"get_benchmark_category"`
  13. GpuType string `form:"gpu_type"`
  14. ResourceSpecId int `form:"resource_spec_id" binding:"Required"`
  15. }
  16. type CommitImageCloudBrainForm struct {
  17. Description string `form:"description" binding:"Required"`
  18. Tag string `form:"tag" binding:"Required"`
  19. }
  20. func (f *CreateCloudBrainForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  21. return validate(errs, ctx.Data, f, ctx.Locale)
  22. }