goshare/schema/schema.go

38 lines
865 B
Go
Raw Normal View History

2024-01-23 19:13:51 +00:00
package schema
import "time"
type ShareType = int
const (
ShareDrop = iota
ShareSendSingle
ShareSendMultiple
)
type MimeType = int
const (
MimeTypeText = iota
)
type Share struct {
2024-01-23 19:37:51 +00:00
ShareId int `json:"share_id"`
ShareType ShareType `json:"share_type"`
CreatedAt time.Time `json:"created_at"`
ValidUntil time.Time `json:"valid_until"`
PasswordHash string `json:"password_hash"`
ManagementToken string `json:"management_token"`
Enabled bool `json:"enabled"`
2024-01-23 19:13:51 +00:00
}
type ShareFile struct {
2024-01-23 19:37:51 +00:00
ShareId int `json:"share_id"`
Filename string `json:"filename"`
Mimetype MimeType `json:"mimetype"`
FileHash string `json:"file_hash"`
UploadedAt time.Time `json:"uploaded_at"`
Deleted bool `json:"deleted"`
DownloadCount int `json:"download_count"`
2024-01-23 19:13:51 +00:00
}