Documentation ¶
Index ¶
- type Client
- func (c Client) AsFS(ctx context.Context) FS
- func (cl Client) Create(up UploadParams, body io.Reader) error
- func (cl Client) Delete(path string) error
- func (cl Client) Download(path string) ([]byte, error)
- func (cl Client) GetMetadata(p GetMetadataParams) (Metadata, error)
- func (cl Client) ListFolder(p ListFolderParams) (ListFolderResult, error)
- func (cl Client) ListFolderContinue(cursor string) (ListFolderResult, error)
- func (cl Client) ListFolderLongPoll(ctx context.Context, cursor string, timeout int) (bool, int, error)
- func (db Client) Longpoll(ctx context.Context, dir string, ch chan<- []Metadata)
- type DropboxDirEntry
- func (e *DropboxDirEntry) Close() error
- func (e *DropboxDirEntry) Info() (fs.FileInfo, error)
- func (e *DropboxDirEntry) IsDir() bool
- func (e *DropboxDirEntry) ModTime() time.Time
- func (e *DropboxDirEntry) Mode() fs.FileMode
- func (e *DropboxDirEntry) Name() string
- func (e *DropboxDirEntry) Read(b []byte) (int, error)
- func (e *DropboxDirEntry) ReadDir(n int) ([]fs.DirEntry, error)
- func (e *DropboxDirEntry) Size() int64
- func (e *DropboxDirEntry) Stat() (fs.FileInfo, error)
- func (e *DropboxDirEntry) Sys() interface{}
- func (e *DropboxDirEntry) Type() fs.FileMode
- type FS
- func (f FS) Open(name string) (fs.File, error)
- func (f FS) ReadDir(name string) ([]fs.DirEntry, error)
- func (f FS) ReadFile(name string) ([]byte, error)
- func (f FS) Remove(name string) error
- func (f FS) Stat(name string) (fs.FileInfo, error)
- func (f FS) Sub(dir string) (fs.FS, error)
- func (f FS) Watch(ctx context.Context, dir string) (chan []fsnotify.Event, error)
- func (f FS) WriteFile(name string, contents []byte, _ fs.FileMode) error
- type GetMetadataParams
- type ListFolderParams
- type ListFolderResult
- type Metadata
- type UploadParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client gives access to the Dropbox API
func (Client) Create ¶
func (cl Client) Create(up UploadParams, body io.Reader) error
Create writes the body to path.
func (Client) Delete ¶
Delete a file or folder. Official docs are at https://www.dropbox.com/developers/documentation/http/documentation#files-delete
func (Client) GetMetadata ¶
func (cl Client) GetMetadata(p GetMetadataParams) (Metadata, error)
GetMetadata gets metadata for a file or directory.
func (Client) ListFolder ¶
func (cl Client) ListFolder(p ListFolderParams) (ListFolderResult, error)
func (Client) ListFolderContinue ¶
func (cl Client) ListFolderContinue(cursor string) (ListFolderResult, error)
func (Client) ListFolderLongPoll ¶
type DropboxDirEntry ¶
func (*DropboxDirEntry) Close ¶
func (e *DropboxDirEntry) Close() error
func (*DropboxDirEntry) IsDir ¶
func (e *DropboxDirEntry) IsDir() bool
func (*DropboxDirEntry) ModTime ¶
func (e *DropboxDirEntry) ModTime() time.Time
func (*DropboxDirEntry) Mode ¶
func (e *DropboxDirEntry) Mode() fs.FileMode
func (*DropboxDirEntry) Name ¶
func (e *DropboxDirEntry) Name() string
func (*DropboxDirEntry) Size ¶
func (e *DropboxDirEntry) Size() int64
func (*DropboxDirEntry) Sys ¶
func (e *DropboxDirEntry) Sys() interface{}
func (*DropboxDirEntry) Type ¶
func (e *DropboxDirEntry) Type() fs.FileMode
type GetMetadataParams ¶
type GetMetadataParams struct { Path string `json:"path"` IncludeMediaInfo bool `json:"include_media_info,omitempty"` IncludeDeleted bool `json:"include_deleted,omitempty"` IncludePropertyGroups []string `json:"include_property_groups,omitempty"` }
GetMetadataParams maps to the parameters to get-metadata, documented here: https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata
type ListFolderParams ¶
type ListFolderParams struct { Path string `json:"path"` Recursive bool `json:"recursive"` IncludeMediaInfo bool `json:"include_media_info"` IncludeDeleted bool `json:"include_deleted"` IncludeMountedFolders bool `json:"include_mounted_folders"` IncludeNonDownloadableFiles bool `json:"include_non_downloadable_files"` Limit uint32 `json:"limit,omitempty"` }
ListFolderParams docs are at https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
type ListFolderResult ¶
type Metadata ¶
type Metadata struct { Tag string `json:".tag"` Name string `json:"name"` ID string `json:"id"` ClientModified string `json:"client_modified"` // could be time.Time ServerModified string `json:"server_modified"` // could be time.Time Rev string `json:"rev"` Size int `json:"size"` PathLower string `json:"path_lower"` PathDisplay string `json:"path_display"` SharingInfo struct { ParentSharedFolderID string `json:"parent_shared_folder_id"` ModifiedBy string `json:"modified_by"` ReadOnly bool `json:"read_only"` TraverseOnly bool `json:"traverse_only"` NoAccess bool `json:"no_access"` } `json:"sharing_info"` IsDownloadable bool `json:"is_downloadable"` PropertyGroups []struct { TemplateID string `json:"template_id"` Fields []struct { Name string `json:"name"` Value string `json:"value"` } } `json:"property_groups"` ContentHash string `json:"content_hash"` FileLockInfo struct { IsLockholder bool `json:"is_lockholder"` LockholderName string `json:"lockholder_name"` Created string `json:"created"` // could be time.Time } `json:"file_lock_info"` }
Metadata is defined at https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
type UploadParams ¶
type UploadParams struct { Path string `json:"path"` Autorename bool `json:"autorename,omitempty"` Mode string `json:"mode,omitempty"` }
UploadParams maps to the parameters to file-upload, documented here: https://www.dropbox.com/developers/documentation/http/documentation#files-upload