Documentation
¶
Overview ¶
Package api has type definitions for drime
Converted from the API docs with help from https://mholt.github.io/json-to-go/
Index ¶
- Constants
- type CompletedPart
- type CopyRequest
- type CopyResponse
- type CreateFolderRequest
- type CreateFolderResponse
- type DeleteRequest
- type DeleteResponse
- type Error
- type Item
- type Listing
- type MoveRequest
- type MoveResponse
- type MultiPartAbort
- type MultiPartCompleteRequest
- type MultiPartCompleteResponse
- type MultiPartCreateRequest
- type MultiPartCreateResponse
- type MultiPartEntriesRequest
- type MultiPartEntriesResponse
- type MultiPartGetURLsRequest
- type MultiPartGetURLsResponse
- type Permissions
- type SpaceUsageResponse
- type UpdateItemRequest
- type UpdateItemResponse
- type UploadResponse
- type User
Constants ¶
const (
ItemTypeFolder = "folder"
)
Types of things in Item
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompletedPart ¶
CompletedPart Type for completed parts when making a multipart upload.
type CopyRequest ¶
type CopyRequest struct {
EntryIDs []string `json:"entryIds"`
DestinationID string `json:"destinationId"`
}
CopyRequest is the input to /file-entries/duplicate
type CopyResponse ¶
CopyResponse is returned by POST /file-entries/duplicate
type CreateFolderRequest ¶
type CreateFolderRequest struct {
Name string `json:"name"`
ParentID json.Number `json:"parentId,omitempty"`
}
CreateFolderRequest for a folder
type CreateFolderResponse ¶
CreateFolderResponse for a folder
type DeleteRequest ¶
type DeleteRequest struct {
EntryIDs []string `json:"entryIds"`
DeleteForever bool `json:"deleteForever"`
}
DeleteRequest is the input to DELETE /file-entries
type DeleteResponse ¶
type DeleteResponse struct {
Status string `json:"status"`
Message string `json:"message"`
Errors map[string]string `json:"errors"`
}
DeleteResponse is the input to DELETE /file-entries
type Error ¶
type Error struct {
Message string `json:"message"`
}
Error is returned from drime when things go wrong
type Item ¶
type Item struct {
ID json.Number `json:"id"`
Name string `json:"name"`
Description any `json:"description"`
FileName string `json:"file_name"`
Mime string `json:"mime"`
Color any `json:"color"`
Backup bool `json:"backup"`
Tracked int `json:"tracked"`
FileSize int64 `json:"file_size"`
UserID json.Number `json:"user_id"`
ParentID json.Number `json:"parent_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt any `json:"deleted_at"`
IsDeleted int `json:"is_deleted"`
Path string `json:"path"`
DiskPrefix any `json:"disk_prefix"`
Type string `json:"type"`
Extension any `json:"extension"`
FileHash any `json:"file_hash"`
Public bool `json:"public"`
Thumbnail bool `json:"thumbnail"`
MuxStatus any `json:"mux_status"`
ThumbnailURL any `json:"thumbnail_url"`
WorkspaceID int `json:"workspace_id"`
IsEncrypted int `json:"is_encrypted"`
Iv any `json:"iv"`
VaultID any `json:"vault_id"`
OwnerID int `json:"owner_id"`
Hash string `json:"hash"`
URL string `json:"url"`
Users []User `json:"users"`
Tags []any `json:"tags"`
Permissions Permissions `json:"permissions"`
}
Item describes a folder or a file as returned by /drive/file-entries
type Listing ¶
type Listing struct {
CurrentPage int `json:"current_page"`
Data []Item `json:"data"`
From int `json:"from"`
LastPage int `json:"last_page"`
NextPage int `json:"next_page"`
PerPage int `json:"per_page"`
PrevPage int `json:"prev_page"`
To int `json:"to"`
Total int `json:"total"`
}
Listing response
type MoveRequest ¶
type MoveRequest struct {
EntryIDs []string `json:"entryIds"`
DestinationID string `json:"destinationId"`
}
MoveRequest is the input to /file-entries/move
type MoveResponse ¶
MoveResponse is returned by POST /file-entries/move
type MultiPartAbort ¶
MultiPartAbort is the input of POST /s3/multipart/abort
type MultiPartCompleteRequest ¶
type MultiPartCompleteRequest struct {
UploadID string `json:"uploadId"`
Key string `json:"key"`
Parts []CompletedPart `json:"parts"`
}
MultiPartCompleteRequest is the input to POST /s3/multipart/complete
type MultiPartCompleteResponse ¶
type MultiPartCompleteResponse struct {
Location string `json:"location"`
}
MultiPartCompleteResponse is the result of POST /s3/multipart/complete
type MultiPartCreateRequest ¶
type MultiPartCreateRequest struct {
Filename string `json:"filename"`
Mime string `json:"mime"`
Size int64 `json:"size"`
Extension string `json:"extension"`
ParentID json.Number `json:"parent_id"`
RelativePath string `json:"relativePath"`
}
MultiPartCreateRequest is the input of POST /s3/multipart/create
type MultiPartCreateResponse ¶
MultiPartCreateResponse is returned by POST /s3/multipart/create
type MultiPartEntriesRequest ¶
type MultiPartEntriesRequest struct {
ClientMime string `json:"clientMime"`
ClientName string `json:"clientName"`
Filename string `json:"filename"`
Size int64 `json:"size"`
ClientExtension string `json:"clientExtension"`
ParentID json.Number `json:"parent_id"`
RelativePath string `json:"relativePath"`
}
MultiPartEntriesRequest is the input to POST /s3/entries
type MultiPartEntriesResponse ¶
type MultiPartEntriesResponse struct {
FileEntry Item `json:"fileEntry"`
}
MultiPartEntriesResponse is the result of POST /s3/entries
type MultiPartGetURLsRequest ¶
type MultiPartGetURLsRequest struct {
UploadID string `json:"uploadId"`
Key string `json:"key"`
PartNumbers []int `json:"partNumbers"`
}
MultiPartGetURLsRequest is the input of POST /s3/multipart/batch-sign-part-urls
type MultiPartGetURLsResponse ¶
type MultiPartGetURLsResponse struct {
URLs []struct {
URL string `json:"url"`
PartNumber int32 `json:"partNumber"`
} `json:"urls"`
}
MultiPartGetURLsResponse is the result of POST /s3/multipart/batch-sign-part-urls
type Permissions ¶
type Permissions struct {
FilesUpdate bool `json:"files.update"`
FilesCreate bool `json:"files.create"`
FilesDownload bool `json:"files.download"`
FilesDelete bool `json:"files.delete"`
}
Permissions for a file
type SpaceUsageResponse ¶
type SpaceUsageResponse struct {
Used int64 `json:"used"`
Available int64 `json:"available"`
Status string `json:"status"`
SEO any `json:"seo"`
}
SpaceUsageResponse is returned by GET /user/space-usage
type UpdateItemRequest ¶
type UpdateItemRequest struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
}
UpdateItemRequest describes the updates to be done to an item for PUT /file-entries/{id}/
type UpdateItemResponse ¶
UpdateItemResponse is returned by PUT /file-entries/{id}/
type UploadResponse ¶
UploadResponse for a file