Documentation
¶
Index ¶
- Constants
- type CommitInfo
- type CreateFolderArg
- type DeleteArg
- type DownloadArg
- type DownloadV1
- type Dropbox
- func (c *Dropbox) ApiRequest(req *httpclient.RequestData) (res *http.Response, err error)
- func (c *Dropbox) ContentRequest(req *httpclient.RequestData) (res *http.Response, err error)
- func (c *Dropbox) Copy(ctx context.Context, arg *RelocationArg) (result *Metadata, err error)
- func (c *Dropbox) CreateFolder(ctx context.Context, arg *CreateFolderArg) (result *Metadata, err error)
- func (c *Dropbox) Delete(ctx context.Context, arg *DeleteArg) (result *Metadata, err error)
- func (c *Dropbox) Download(ctx context.Context, arg *DownloadArg, span *ioutils.FileSpan) (reader io.ReadCloser, result *Metadata, err error)
- func (c *Dropbox) GetMetadata(ctx context.Context, arg *GetMetadataArg) (result *Metadata, err error)
- func (c *Dropbox) GetSpaceUsage(ctx context.Context) (result *SpaceUsage, err error)
- func (c *Dropbox) HandleError(err error) error
- func (c *Dropbox) ListFolder(ctx context.Context, arg *ListFolderArg) (result *ListFolderResult, err error)
- func (c *Dropbox) ListFolderContinue(ctx context.Context, arg *ListFolderContinueArg) (result *ListFolderResult, err error)
- func (c *Dropbox) Move(ctx context.Context, arg *RelocationArg) (result *Metadata, err error)
- func (c *Dropbox) Request(client *httpclient.HTTPClient, req *httpclient.RequestData) (res *http.Response, err error)
- func (c *Dropbox) UploadSessionAppend(ctx context.Context, arg *UploadSessionCursor, reader io.Reader) (err error)
- func (c *Dropbox) UploadSessionFinish(ctx context.Context, arg *UploadSessionFinishArg) (res *Metadata, err error)
- func (c *Dropbox) UploadSessionStart(ctx context.Context, reader io.Reader) (res *UploadSessionStartResult, err error)
- type DropboxError
- type DropboxErrorDetails
- type GetMetadataArg
- type ListFolderArg
- type ListFolderContinueArg
- type ListFolderResult
- type LookupError
- type Metadata
- type RelocationArg
- type SpaceAllocation
- type SpaceUsage
- type UploadSessionCursor
- type UploadSessionFinishArg
- type UploadSessionStartResult
- type WriteMode
Constants ¶
View Source
const (
DropboxClientModifiedFormat = "2006-01-02T15:04:05Z07"
)
View Source
const MetadataDeleted = "deleted"
View Source
const MetadataFile = "file"
View Source
const MetadataFolder = "folder"
View Source
const SpaceAllocationIndividual = "individual"
View Source
const SpaceAllocationTeam = "team"
View Source
const WriteModeAdd = "add"
View Source
const WriteModeOverwrite = "overwrite"
View Source
const WriteModeUpdate = "update"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitInfo ¶
type CreateFolderArg ¶
type CreateFolderArg struct {
Path string `json:"path"`
}
type DownloadArg ¶
type DownloadArg struct {
Path string `json:"path"`
}
type DownloadV1 ¶
type DownloadV1 struct { ContentLength int64 ETag string Reader io.ReadCloser }
type Dropbox ¶
type Dropbox struct { ApiHTTPClient *httpclient.HTTPClient ContentHTTPClient *httpclient.HTTPClient }
func NewDropbox ¶
func (*Dropbox) ApiRequest ¶
func (*Dropbox) ContentRequest ¶
func (*Dropbox) CreateFolder ¶
func (*Dropbox) Download ¶
func (c *Dropbox) Download(ctx context.Context, arg *DownloadArg, span *ioutils.FileSpan) (reader io.ReadCloser, result *Metadata, err error)
func (*Dropbox) GetMetadata ¶
func (*Dropbox) GetSpaceUsage ¶
func (c *Dropbox) GetSpaceUsage(ctx context.Context) (result *SpaceUsage, err error)
func (*Dropbox) HandleError ¶
func (*Dropbox) ListFolder ¶
func (c *Dropbox) ListFolder(ctx context.Context, arg *ListFolderArg) (result *ListFolderResult, err error)
func (*Dropbox) ListFolderContinue ¶
func (c *Dropbox) ListFolderContinue(ctx context.Context, arg *ListFolderContinueArg) (result *ListFolderResult, err error)
func (*Dropbox) UploadSessionAppend ¶
func (*Dropbox) UploadSessionFinish ¶
func (*Dropbox) UploadSessionStart ¶
type DropboxError ¶
type DropboxError struct { ErrorSummary string `json:"error_summary"` Err DropboxErrorDetails `json:"error"` HttpClientError *httpclient.InvalidStatusError }
func IsDropboxError ¶
func IsDropboxError(err error) (dropboxErr *DropboxError, ok bool)
func (*DropboxError) Error ¶
func (e *DropboxError) Error() string
type DropboxErrorDetails ¶
type DropboxErrorDetails struct { Tag string `json:".tag"` Path *LookupError `json:"path"` PathLookup *LookupError `json:"path_lookup"` }
type GetMetadataArg ¶
type ListFolderArg ¶
type ListFolderContinueArg ¶
type ListFolderContinueArg struct {
Cursor string `json:"cursor"`
}
type ListFolderResult ¶
type LookupError ¶
type LookupError struct {
Tag string `json:".tag"`
}
type Metadata ¶
type Metadata struct { Tag string `json:".tag"` Name string `json:"name"` PathLower string `json:"path_lower"` ClientModified time.Time `json:"client_modified"` ServerModified time.Time `json:"server_modified"` Rev string `json:"rev"` Size int64 `json:"size"` Id string `json:"id"` ETag string ContentLength int64 }
type RelocationArg ¶
type SpaceAllocation ¶
type SpaceUsage ¶
type SpaceUsage struct { Used int64 `json:"used"` Allocation *SpaceAllocation `json:"allocation"` }
type UploadSessionCursor ¶
type UploadSessionFinishArg ¶
type UploadSessionFinishArg struct { Cursor *UploadSessionCursor `json:"cursor"` Commit *CommitInfo `json:"commit"` }
type UploadSessionStartResult ¶
type UploadSessionStartResult struct {
SessionId string `json:"session_id"`
}
Click to show internal directories.
Click to hide internal directories.