storage.go 998 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package api
  2. type StorageType string
  3. const (
  4. StorageS3 StorageType = "S3"
  5. )
  6. type StorageConfig struct {
  7. S3Config *StorageS3Config `json:"s3Config"`
  8. }
  9. type StorageS3Config struct {
  10. EndPoint string `json:"endPoint"`
  11. Region string `json:"region"`
  12. AccessKey string `json:"accessKey"`
  13. SecretKey string `json:"secretKey"`
  14. Bucket string `json:"bucket"`
  15. URLPrefix string `json:"urlPrefix"`
  16. }
  17. type Storage struct {
  18. ID int `json:"id"`
  19. Name string `json:"name"`
  20. Type StorageType `json:"type"`
  21. Config *StorageConfig `json:"config"`
  22. }
  23. type StorageCreate struct {
  24. Name string `json:"name"`
  25. Type StorageType `json:"type"`
  26. Config *StorageConfig `json:"config"`
  27. }
  28. type StoragePatch struct {
  29. ID int `json:"id"`
  30. Type StorageType `json:"type"`
  31. Name *string `json:"name"`
  32. Config *StorageConfig `json:"config"`
  33. }
  34. type StorageFind struct {
  35. ID *int `json:"id"`
  36. }
  37. type StorageDelete struct {
  38. ID int `json:"id"`
  39. }