Documentation
¶
Index ¶
- Constants
- func CountFiles(ctx context.Context, orgID int64) (int64, error)
- func DeleteItem(ctx context.Context, orgID, id int64) error
- func DeleteUpload(ctx context.Context, id string) error
- func InsertItem(ctx context.Context, item *ShareItem) error
- func InsertUpload(ctx context.Context, upload *ShareUpload) error
- func IsErrNotExist(err error) bool
- func ReservedBytes(ctx context.Context, orgID int64) (int64, error)
- func SetQuota(ctx context.Context, orgID, maxBytes int64) error
- func UpdateExpiry(ctx context.Context, item *ShareItem) error
- func UpdateStorageKey(ctx context.Context, item *ShareItem) error
- func UpdateUploadProgress(ctx context.Context, upload *ShareUpload) error
- func UsedBytes(ctx context.Context, orgID int64) (int64, error)
- type ErrNotExist
- type ShareItem
- func FindChild(ctx context.Context, orgID, parentID int64, name, kind string) (*ShareItem, error)
- func GetItem(ctx context.Context, orgID, id int64) (*ShareItem, error)
- func ListExpired(ctx context.Context, now timeutil.TimeStamp) ([]*ShareItem, error)
- func ListItems(ctx context.Context, orgID, parentID int64) ([]*ShareItem, error)
- type ShareQuota
- type ShareUpload
Constants ¶
const ( KindFile = "file" KindDir = "dir" KindText = "text" )
Variables ¶
This section is empty.
Functions ¶
func CountFiles ¶
CountFiles counts files and text notes, not folders.
func DeleteItem ¶
DeleteItem removes one row.
func DeleteUpload ¶
DeleteUpload removes a session.
func InsertItem ¶
InsertItem stores a new share object.
func InsertUpload ¶
func InsertUpload(ctx context.Context, upload *ShareUpload) error
InsertUpload stores a resumable session.
func ReservedBytes ¶
ReservedBytes is stored objects plus in-progress uploads.
func SetQuota ¶
SetQuota stores a per-organization cap. Zero deletes the override and the default applies.
func UpdateExpiry ¶
UpdateExpiry stores a new deadline. Zero means the object is permanent.
func UpdateStorageKey ¶
UpdateStorageKey stores the object path after the row id exists.
func UpdateUploadProgress ¶
func UpdateUploadProgress(ctx context.Context, upload *ShareUpload) error
UpdateUploadProgress stores covered ranges after a chunk lands.
Types ¶
type ErrNotExist ¶
type ErrNotExist struct{ ID int64 }
ErrNotExist is returned when a share object is missing.
func (ErrNotExist) Error ¶
func (err ErrNotExist) Error() string
func (ErrNotExist) Unwrap ¶
func (err ErrNotExist) Unwrap() error
type ShareItem ¶
type ShareItem struct {
}
ShareItem is one file, folder, or text note in an organization share.
func ListExpired ¶
ListExpired returns objects whose deadline has passed.
type ShareQuota ¶
type ShareQuota struct {
}
ShareQuota is an optional per-organization cap. A missing row uses the server default.
func GetQuota ¶
func GetQuota(ctx context.Context, orgID int64) (*ShareQuota, error)
GetQuota loads a per-organization cap.
func (ShareQuota) TableName ¶
func (ShareQuota) TableName() string
TableName keeps quota rows beside share items.
type ShareUpload ¶
type ShareUpload struct {
}
ShareUpload is an in-progress resumable upload.
func FindUpload ¶
func FindUpload(ctx context.Context, orgID, parentID, uploaderID, size int64, name string) (*ShareUpload, error)
FindUpload returns an in-progress session with the same name and size.
func ListExpiredUploads ¶
ListExpiredUploads returns sessions whose deadline has passed.
func (ShareUpload) TableName ¶
func (ShareUpload) TableName() string
TableName keeps upload sessions beside share items.