goshare/schema/schema.go

38 lines
865 B
Go

package schema
import "time"
type ShareType = int
const (
ShareDrop = iota
ShareSendSingle
ShareSendMultiple
)
type MimeType = int
const (
MimeTypeText = iota
)
type Share struct {
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"`
}
type ShareFile struct {
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"`
}