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 1.1 kB

3 years ago
5 years ago
5 years ago
12345678910111213141516171819202122232425262728
  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. BenchmarkTypeID int `form:"benchmark_types_id"`
  16. BenchmarkChildTypeID int `form:"benchmark_child_types_id"`
  17. }
  18. type CommitImageCloudBrainForm struct {
  19. Description string `form:"description" binding:"Required"`
  20. Tag string `form:"tag" binding:"Required"`
  21. }
  22. func (f *CreateCloudBrainForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  23. return validate(errs, ctx.Data, f, ctx.Locale)
  24. }