Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTokenRequired = errors.New("dropbox: access token is required")
)
Errors specific to the Dropbox backend.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// AccessToken is the OAuth2 access token (required).
AccessToken string
// RefreshToken is the OAuth2 refresh token for long-lived sessions.
RefreshToken string
// AppKey is the Dropbox app key (for token refresh).
AppKey string
// AppSecret is the Dropbox app secret (for token refresh).
AppSecret string
// Root is the base path on Dropbox.
// All paths are relative to this directory.
// Use "" for the root of the app folder or full Dropbox.
Root string
// ChunkSize is the size in bytes for chunked uploads.
// Default: 150 MB (Dropbox recommends this for stability).
ChunkSize int64
// Concurrency is the maximum number of concurrent operations.
// Default: 4.
Concurrency int
}
Config holds configuration for the Dropbox backend.
func ConfigFromEnv ¶
func ConfigFromEnv() Config
ConfigFromEnv creates a Config from environment variables. Environment variables:
- OMNISTORAGE_DROPBOX_ACCESS_TOKEN: OAuth2 access token
- OMNISTORAGE_DROPBOX_REFRESH_TOKEN: OAuth2 refresh token
- OMNISTORAGE_DROPBOX_APP_KEY: Dropbox app key
- OMNISTORAGE_DROPBOX_APP_SECRET: Dropbox app secret
- OMNISTORAGE_DROPBOX_ROOT: Base path
func ConfigFromMap ¶
ConfigFromMap creates a Config from a string map. Supported keys:
- access_token: OAuth2 access token (required)
- refresh_token: OAuth2 refresh token
- app_key: Dropbox app key
- app_secret: Dropbox app secret
- root: Base path
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with default values.
Click to show internal directories.
Click to hide internal directories.