Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OcmProtocol ¶ added in v3.5.0
type OcmProtocol int
OcmProtocol is the protocol used by the recipient of an OCM share (both incoming and outgoing) to access the shared resource.
const ( // WebDAVProtocol is the OCM `webdav` protocol. WebDAVProtocol OcmProtocol = iota // WebappProtocol is the OCM `webapp` protocol. WebappProtocol // TransferProtocol is the OCM `datatx` protocol. TransferProtocol )
type OcmReceivedShare ¶ added in v3.4.0
type OcmReceivedShare struct {
}
OcmReceivedShare represents an OCM share received from a remote user.
type OcmReceivedShareProtocol ¶ added in v3.4.0
type OcmReceivedShareProtocol struct {
Permissions int `gorm:"default:null"`
Size uint64 `gorm:"default:null"`
}
OcmReceivedShareProtocol represents the protocol used to access an OCM share received from a remote user.
type OcmShare ¶ added in v3.4.0
type OcmShare struct {
}
OcmShare represents an OCM share for a remote user. The unique index ensures that there can only be one share per (inode, instance, recipient) tuple, unless the share is deleted. In addition, tokens must be unique. TODO(lopresti) see if we can consolidate Owner and Initiator with UIDOwner and UIDInitiator in ProtoShare
type OcmShareProtocol ¶ added in v3.5.0
type OcmShareProtocol struct {
}
OcmShareProtocol represents the protocol used to access an OCM share, named AccessMethod in the OCM CS3 APIs.
type OcmShareState ¶ added in v3.4.0
type OcmShareState int
For OCM shares, OcmShareState is their state.
const ( OcmShareStatePending OcmShareState = iota OcmShareStateAccepted OcmShareStateRejected )
type OcmShareType ¶ added in v3.5.0
type OcmShareType int
For OCM shares, OcmShareType is the type of the recipient.
const ( OcmShareTypeUser OcmShareType = iota OcmShareTypeGroup )
type ProtoShare ¶
type ProtoShare 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
//DeletedAt gorm.DeletedAt `gorm:"index"`
//Inode string `gorm:"size:32;index"`
//Instance string `gorm:"size:32;index"`
}
This is the base model for all share types and embeds parts of gorm.Model. We can't use it, because we want our ID to be a foreign key to ShareID, but we incorporate the date fields from GORM. The commented-out fields would logically belong here, but we define them in each specific type to control the unique indexes to be enforced in the corresponding tables.
type PublicLink ¶
type PublicLink struct {
DeletedAt gorm.DeletedAt `gorm:"index"`
Inode string `gorm:"size:32"`
Instance string `gorm:"size:32"`
Token string `gorm:"uniqueIndex:u_link_token;size:32"` // Current tokens are only 16 chars long, but old tokens used to be 32 characters
Quicklink bool
NotifyUploads bool
NotifyUploadsExtraRecipients string
Password string `gorm:"size:255"`
LinkName string `gorm:"size:512"` // Users can give a name to a share
}
PublicLink is a public link share. We only enforce a unique constraint on the token.
func (*PublicLink) AsCS3PublicShare ¶
func (p *PublicLink) AsCS3PublicShare() *link.PublicShare
type Share ¶
type Share struct {
}
Share is a regular share between users or groups. The unique index ensures that there can only be one share per (inode, instance, recipient) tuple, unless the share is deleted.
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 ShareID ¶
type ShareID struct {
}
ShareID only contains IDs of shares and public links. This is because the Web UI requires that shares and public links do not share an ID, so we need a shared table to make sure that there are no duplicates. This is implemented by having ShareID have an ID that is auto-increment, and shares and public links will have their ID be a foreign key to ShareID When creating a new share, we will then first create an ID entry and use this for the ID
type ShareState ¶
type ShareState struct {
}
ShareState represents the state of a share for a specific recipient.