Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessMethod ¶ added in v3.4.0
type AccessMethod int
AccessMethod is method granted by the sharer to access the shared resource.
const ( // WebDAVAccessMethod indicates an access using WebDAV to the share. WebDAVAccessMethod AccessMethod = iota // WebappAccessMethod indicates an access using a collaborative // application to the share. WebappAccessMethod // TransferAccessMethod indicates a share for a transfer. TransferAccessMethod )
type BaseModel ¶
type BaseModel struct {
// Id has to be called Id and not ID, otherwise the foreign key will not work
// ID is a special field in GORM, which it uses as the default Primary Key
Id uint `gorm:"primaryKey;not null;autoIncrement:false"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
}
We cannot use gorm.Model, because we want our ID to be a foreign key to ShareID
type OcmItemType ¶ added in v3.4.0
type OcmItemType int
ItemType is the type of the shares resource.
const ( // ItemTypeFile is used when the shared resource is a file. OcmItemTypeFile OcmItemType = iota // ItemTypeFolder is used when the shared resource is a folder. OcmItemTypeFolder )
type OcmReceivedShareProtocol ¶ added in v3.4.0
type OcmReceivedShareProtocol struct {
Permissions int `gorm:"default:null"`
Size uint64 `gorm:"default:null"`
}
OCM Received Share Protocols
type OcmShare ¶ added in v3.4.0
type OcmShare struct {
// The fields of the base model had to be copied since we need an index on DeletedAt + unique constraints
// Id has to be called Id and not ID, otherwise the foreign key will not work
// ID is a special field in GORM, which it uses as the default Primary Key
// Needs to be indexed because shares that are deleted need to be unique so we can add a new share after it was deleted
}
type OcmShareState ¶ added in v3.4.0
type OcmShareState int
ShareState is the state of the share.
const ( ShareStatePending OcmShareState = iota ShareStateAccepted ShareStateRejected )
type OcmSharesAccessMethod ¶ added in v3.4.0
type OcmSharesAccessMethod struct {
Type AccessMethod `gorm:"not null;uniqueIndex:idx_ocm_share_method"`
Permissions int `gorm:"default:null"`
}
OCM Shares Access Methods
type ProtoShare ¶
type ProtoShare struct {
// Including gorm.Model will embed a number of gorm-default fields
}
ProtoShare contains fields that are shared between PublicLinks and Shares. Unfortunately, because these are shared, we cannot name our indexes because then two indexes with the same name would be created
type Protocol ¶ added in v3.4.0
type Protocol int
Protocol is the protocol the recipient of the share uses to access the shared resource.
type PublicLink ¶
type PublicLink struct {
// Current tokens are only 16 chars long, but old tokens used to be 32 characters
Token string `gorm:"uniqueIndex:i_token;size:32"`
Quicklink bool
NotifyUploads bool
NotifyUploadsExtraRecipients string
Password string `gorm:"size:255"`
// Users can give a name to a share
LinkName string `gorm:"size:512"`
}
func (*PublicLink) AsCS3PublicShare ¶
func (p *PublicLink) AsCS3PublicShare() *link.PublicShare
type Share ¶
type Share struct {
}
func (*Share) AsCS3ReceivedShare ¶
func (s *Share) AsCS3ReceivedShare(state *ShareState, granteeType userpb.UserType) *collaboration.ReceivedShare
func (*Share) AsCS3Share ¶
func (s *Share) AsCS3Share(granteeType userpb.UserType) *collaboration.Share
type ShareState ¶
type ShareState struct {
// Can not be uid because of lw accs
}
Click to show internal directories.
Click to hide internal directories.