Help us shape the future of Go! Take the 2026 Go Developer Survey

dropbox

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 2 Imported by: 1

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

func ConfigFromMap(m map[string]string) Config

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.

func (Config) Validate

func (c Config) Validate() error

Validate checks if the configuration is valid.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL