dropbox

package module
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: MIT Imports: 6 Imported by: 0

README

tantalic.com/dropbox

A simple, incomplete Dropbox API v2 client in Go.

Features

The client is intentionally kept simple and only implements features actively being used for my needs. This currently includes:

  • Listing files in a directory
  • Watching a directory for changes
  • Downloading files

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Summary     string                 `json:"error_summary"`
	UserMessage string                 `json:"user_message"`
	Details     map[string]interface{} `json:"error"`
}

func (APIError) Error

func (e APIError) Error() string

type Client

type Client struct {
	AuthorizationToken string
	BaseURL            string
	HttpClient         http.Client
}

func (*Client) Continue

func (c *Client) Continue(cursor string, ch chan MetaData) (string, error)

func (*Client) Download

func (c *Client) Download(path string) (io.ReadCloser, error)

func (*Client) List

func (c *Client) List(o ListOptions, ch chan MetaData) (string, error)

func (*Client) Watch

func (c *Client) Watch(interval time.Duration, o ListOptions, ch chan MetaData) error

type ListOptions

type ListOptions struct {
	Path                            string `json:"path"`
	Recursive                       bool   `json:"recursive,omitempty"`
	IncludeMediaInfo                bool   `json:"include_media_info,omitempty"`
	IncludeDeleted                  bool   `json:"include_deleted,omitempty"`
	IncludeHasExplicitSharedMembers bool   `json:"include_has_explicit_shared_members,omitempty"`
}

type MetaData

type MetaData struct {
	Type        string `json:".tag"`
	Name        string `json:"name"`
	Size        uint64 `json:"size"`
	ID          string `json:"id"`
	Revision    string `json:"rev"`
	Path        string `json:"path_lower"`
	DisplayPath string `json:"path_display"`
}

func (*MetaData) IsFile

func (m *MetaData) IsFile() bool

func (*MetaData) IsFolder

func (m *MetaData) IsFolder() bool

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL