Documentation
¶
Index ¶
- Constants
- Variables
- func GetModels() []interface{}
- type AccessRule
- type AccountDeletion
- type CronJob
- type CronJobLog
- type CronJobLogType
- type CronJobState
- type EmailVerification
- type PasswordReset
- type Pin
- type PublicKey
- type Request
- type RequestOperationType
- type RequestStatusType
- type S3Upload
- type SiaUpload
- type TUSRequest
- type TusLock
- type Upload
- type User
Constants ¶
View Source
const ( RequestStatusPending RequestStatusType = "pending" RequestStatusProcessing RequestStatusType = "processing" RequestStatusCompleted RequestStatusType = "completed" RequestStatusFailed RequestStatusType = "failed" RequestStatusDuplicate RequestStatusType = "duplicate" RequestOperationUpload RequestOperationType = "post_upload" RequestOperationTusUpload RequestOperationType = "tus_upload" RequestOperationPin RequestOperationType = "pin" )
Variables ¶
View Source
var (
ErrTusLockBusy = errors.New("lock is currently held by another process")
)
Functions ¶
Types ¶
type AccessRule ¶ added in v0.2.0
type AccessRule struct { gorm.Model Ptype string `gorm:"size:512;index:idx_access_rule,unique,length:100"` V0 string `gorm:"size:512;index:idx_access_rule,unique,length:100"` V1 string `gorm:"size:512;index:idx_access_rule,unique,length:100"` V2 string `gorm:"size:512;index:idx_access_rule,unique,length:100"` V3 string `gorm:"size:512;index:idx_access_rule,unique,length:100"` V4 string `gorm:"size:512;index:idx_access_rule,unique,length:100"` V5 string `gorm:"size:512;index:idx_access_rule,unique,length:100"` }
type AccountDeletion ¶ added in v0.2.0
type CronJob ¶
type CronJob struct { gorm.Model UUID types.BinaryUUID `gorm:"type:binary(16);uniqueIndex"` Function string `gorm:"type:varchar(255);"` Args string `gorm:"type:longtext;"` LastRun *time.Time Failures uint64 State CronJobState `gorm:"type:varchar(20);default:'queued'"` LastHeartbeat *time.Time Version uint64 `gorm:"default:0"` }
type CronJobLog ¶ added in v0.2.0
type CronJobLogType ¶ added in v0.2.0
type CronJobLogType string
const (
CronJobLogTypeFailure CronJobLogType = "failure"
)
type CronJobState ¶ added in v0.2.0
type CronJobState string
const ( CronJobStateQueued CronJobState = "queued" CronJobStateProcessing CronJobState = "processing" CronJobStateCompleted CronJobState = "completed" CronJobStateFailed CronJobState = "failed" )
type EmailVerification ¶
type PasswordReset ¶
type Request ¶ added in v0.2.0
type Request struct { gorm.Model Operation RequestOperationType `gorm:"index:idx_request_operation_system"` Protocol string Status RequestStatusType StatusMessage string System bool `gorm:"default:false;index:idx_request_operation_system"` UserID uint User User SourceIP string HashType uint64 Hash mh.Multihash `gorm:"type:varbinary(64);index"` CIDType uint64 `gorm:"null;column:cid_type"` UploadHash mh.Multihash `gorm:"type:varbinary(64);index"` UploadHashCIDType uint64 `gorm:"null;column:upload_hash_cid_type"` Size uint64 MimeType string Metadata datatypes.JSON }
type RequestOperationType ¶ added in v0.2.0
type RequestOperationType string
type RequestStatusType ¶ added in v0.2.0
type RequestStatusType string
type TUSRequest ¶ added in v0.2.0
type TusLock ¶
type TusLock struct { gorm.Model LockId string `gorm:"index:idx_lock_id,unique"` HolderPID int `gorm:"index"` AcquiredAt time.Time ExpiresAt time.Time ReleaseRequested bool DeletedAt gorm.DeletedAt `gorm:"index:idx_lock_id,unique"` }
func (*TusLock) IsReleaseRequested ¶
type Upload ¶
type Upload struct { gorm.Model UserID uint HashType uint64 Hash mh.Multihash `gorm:"type:varbinary(64);uniqueIndex:idx_upload_hash_deleted_at"` CIDType uint64 `gorm:"column:cid_type"` MimeType string Protocol string User User UploaderIP string Size uint64 Metadata datatypes.JSON DeletedAt gorm.DeletedAt `gorm:"uniqueIndex:idx_upload_hash_deleted_at"` }
type User ¶
type User struct { gorm.Model FirstName string LastName string Email string `gorm:"unique"` PasswordHash string Role string PublicKeys []PublicKey Uploads []Upload LastLogin *time.Time LastLoginIP string OTPEnabled bool `gorm:"default:false;"` OTPVerified bool `gorm:"default:false;"` OTPSecret string OTPAuthUrl string Verified bool `gorm:"default:false;"` EmailVerifications []EmailVerification PasswordResets []PasswordReset }
Click to show internal directories.
Click to hide internal directories.