item.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * @Author: a624669980@163.com a624669980@163.com
  3. * @Date: 2022-12-13 11:05:47
  4. * @LastEditors: a624669980@163.com a624669980@163.com
  5. * @LastEditTime: 2022-12-13 11:05:54
  6. * @FilePath: /drive/internal/driver/item.go
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. */
  9. package driver
  10. type Additional interface{}
  11. type Select string
  12. type Item struct {
  13. Name string `json:"name"`
  14. Type string `json:"type"`
  15. Default string `json:"default"`
  16. Options string `json:"options"`
  17. Required bool `json:"required"`
  18. Help string `json:"help"`
  19. }
  20. type Info struct {
  21. Common []Item `json:"common"`
  22. Additional []Item `json:"additional"`
  23. Config Config `json:"config"`
  24. }
  25. type IRootPath interface {
  26. GetRootPath() string
  27. }
  28. type IRootId interface {
  29. GetRootId() string
  30. }
  31. type RootPath struct {
  32. RootFolderPath string `json:"root_folder_path"`
  33. }
  34. type RootID struct {
  35. RootFolderID string `json:"root_folder_id" omit:"true"`
  36. }
  37. func (r RootPath) GetRootPath() string {
  38. return r.RootFolderPath
  39. }
  40. func (r *RootPath) SetRootPath(path string) {
  41. r.RootFolderPath = path
  42. }
  43. func (r RootID) GetRootId() string {
  44. return r.RootFolderID
  45. }