acd

package
v0.0.0-...-3d01529 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2015 License: ISC Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssetFile   = "FILE"
	AssetFolder = "FOLDER"

	StatusAvailable = "AVAILABLE"
	StatusTrash     = "TRASH"
	StatusPurged    = "PURGED"

	DebugTrace = 1 << 0 // function calls
	DebugHTTP  = 1 << 1 // HTTP return errors
	DebugURL   = 1 << 2 // URL
	DebugBody  = 1 << 3 // raw body
	DebugJSON  = 1 << 4 // pretty JSON
	DebugToken = 1 << 5 // login with amazon token
	DebugLoud  = 1 << 6 // frequent function calls
)

exported contants

Variables

View Source
var (
	ErrNotFound = errors.New("object not found")
)

Functions

This section is empty.

Types

type Asset

type Asset struct {
	// Overlapped
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	Kind         string    `json:"kind"` // ACDAsset*
	Version      int       `json:"version"`
	ModifiedDate time.Time `json:"modifiedDate"`
	CreatedDate  time.Time `json:"createdDate"`
	Labels       []string  `json:"labels"`
	Description  string    `json:"description"`
	CreatedBy    string    `json:"createdBy"`
	Parents      []string  `json:"parents"`
	Status       string    `json:"status"` // ACDStatus*

	// File
	TempLink          string `json:"tempLink"`
	ContentProperties struct {
		Version     int       `json:"version"`
		MD5         string    `json:"md5"`
		Size        int       `json:"size"`
		ContentType string    `json:"contentType"`
		Extension   string    `json:"extension"`
		ContentDate time.Time `json:"contentDate"`
	} `json:"contentProperties"`

	// Folder
	Restricted bool `json:"restricted"`
	IsRoot     bool `json:"isRoot"`
	IsShared   bool `json:"isShared"`
}

Asset is either a file or a folder. Since most fields overlap use Kind to determine which is which.

type Assets

type Assets struct {
	Count     int     `json:"count"`
	NextToken string  `json:"nextToken"`
	Data      []Asset `json:"data"`
}

Assets is a collection of assets. This structure is returned by several commands.

type Client

type Client struct {
	debug.Debugger
	// contains filtered or unexported fields
}

Client context

func NewClient

func NewClient(path string, d debug.Debugger) (*Client, error)

func (*Client) DownloadJSON

func (c *Client) DownloadJSON(id string) ([]byte, error)

func (*Client) GetChildrenJSON

func (c *Client) GetChildrenJSON(id, filter string) (*Assets, error)

func (*Client) GetMetadataFS

func (c *Client) GetMetadataFS(filepath string) (*Asset, error)

func (*Client) GetMetadataJSON

func (c *Client) GetMetadataJSON(id string) (*Asset, error)

func (*Client) GetRoot

func (c *Client) GetRoot() string

func (*Client) MkdirJSON

func (c *Client) MkdirJSON(parent, name string) (*Asset, error)

func (*Client) UploadJSON

func (c *Client) UploadJSON(parent, filename string, payload []byte) (*Asset,
	error)

type CombinedError

type CombinedError struct {
	StatusCode int
	Status     string
	Body       []byte
	ErrorJSON  *ResponseError
}

func IsCombinedError

func IsCombinedError(err error) (*CombinedError, bool)

func NewCombinedError

func NewCombinedError(sc int, status string, body []byte) CombinedError

func (CombinedError) Error

func (c CombinedError) Error() string

type NodeJSON

type NodeJSON struct {
	Name   string   `json:"name"`
	Kind   string   `json:"kind"`
	Labels []string `json:"labels,omitempty"`
	//Properties
	Parents []string `json:"parents,omitempty"`
}

type ResponseError

type ResponseError struct {
	Code    string `json:"code"`
	LogRef  string `json:"logref"`
	Message string `json:"message"`
	Info    struct {
		NodeId string `json:"nodeId"`
	} `json:"info"`
}

ResponseError is returned by cloud drive REST api.

Directories

Path Synopsis
Package token represents an oauth2.TokenSource which has the ability to refresh the access token through the oauth server.
Package token represents an oauth2.TokenSource which has the ability to refresh the access token through the oauth server.

Jump to

Keyboard shortcuts

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