memos/api/storage.go

49 lines
998 B
Go
Raw Normal View History

package api
2023-02-23 19:02:51 +03:00
type StorageType string
const (
StorageS3 StorageType = "S3"
)
type StorageConfig struct {
S3Config *StorageS3Config `json:"s3Config"`
}
type StorageS3Config struct {
EndPoint string `json:"endPoint"`
Region string `json:"region"`
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
Bucket string `json:"bucket"`
URLPrefix string `json:"urlPrefix"`
}
2023-02-23 19:02:51 +03:00
type Storage struct {
ID int `json:"id"`
Name string `json:"name"`
Type StorageType `json:"type"`
Config *StorageConfig `json:"config"`
}
type StorageCreate struct {
2023-02-23 19:02:51 +03:00
Name string `json:"name"`
Type StorageType `json:"type"`
Config *StorageConfig `json:"config"`
}
type StoragePatch struct {
2023-02-23 19:02:51 +03:00
ID int `json:"id"`
Type StorageType `json:"type"`
Name *string `json:"name"`
Config *StorageConfig `json:"config"`
}
type StorageFind struct {
2023-02-23 19:02:51 +03:00
ID *int `json:"id"`
}
type StorageDelete struct {
ID int `json:"id"`
}