rclone: github.com/rclone/rclone/backend/jottacloud/api Index | Files

package api

import "github.com/rclone/rclone/backend/jottacloud/api"


Package Files


type AllocateFileRequest Uses

type AllocateFileRequest struct {
    Bytes    int64  `json:"bytes"`
    Created  string `json:"created"`
    Md5      string `json:"md5"`
    Modified string `json:"modified"`
    Path     string `json:"path"`

AllocateFileRequest to prepare an upload to Jottacloud

type AllocateFileResponse Uses

type AllocateFileResponse struct {
    Name      string `json:"name"`
    Path      string `json:"path"`
    State     string `json:"state"`
    UploadID  string `json:"upload_id"`
    UploadURL string `json:"upload_url"`
    Bytes     int64  `json:"bytes"`
    ResumePos int64  `json:"resume_pos"`

AllocateFileResponse for upload requests

type CustomerInfo Uses

type CustomerInfo struct {
    Username          string      `json:"username"`
    Email             string      `json:"email"`
    Name              string      `json:"name"`
    CountryCode       string      `json:"country_code"`
    LanguageCode      string      `json:"language_code"`
    CustomerGroupCode string      `json:"customer_group_code"`
    BrandCode         string      `json:"brand_code"`
    AccountType       string      `json:"account_type"`
    SubscriptionType  string      `json:"subscription_type"`
    Usage             int64       `json:"usage"`
    Qouta             int64       `json:"quota"`
    BusinessUsage     int64       `json:"business_usage"`
    BusinessQouta     int64       `json:"business_quota"`
    WriteLocked       bool        `json:"write_locked"`
    ReadLocked        bool        `json:"read_locked"`
    LockedCause       interface{} `json:"locked_cause"`
    WebHash           string      `json:"web_hash"`
    AndroidHash       string      `json:"android_hash"`
    IOSHash           string      `json:"ios_hash"`

CustomerInfo provides general information about the account. Required for finding the correct internal username.

type DeviceRegistrationResponse Uses

type DeviceRegistrationResponse struct {
    ClientID     string `json:"client_id"`
    ClientSecret string `json:"client_secret"`

DeviceRegistrationResponse is the response to registering a device

type DriveInfo Uses

type DriveInfo struct {
    Username          string        `xml:"username"`
    AccountType       string        `xml:"account-type"`
    Locked            bool          `xml:"locked"`
    Capacity          int64         `xml:"capacity"`
    MaxDevices        int           `xml:"max-devices"`
    MaxMobileDevices  int           `xml:"max-mobile-devices"`
    Usage             int64         `xml:"usage"`
    ReadLocked        bool          `xml:"read-locked"`
    WriteLocked       bool          `xml:"write-locked"`
    QuotaWriteLocked  bool          `xml:"quota-write-locked"`
    EnableSync        bool          `xml:"enable-sync"`
    EnableFolderShare bool          `xml:"enable-foldershare"`
    Devices           []JottaDevice `xml:"devices>device"`

DriveInfo represents a Jottacloud account

type Error Uses

type Error struct {
    StatusCode int    `xml:"code"`
    Message    string `xml:"message"`
    Reason     string `xml:"reason"`
    Cause      string `xml:"cause"`

Error is a custom Error for wrapping Jottacloud error responses

func (*Error) Error Uses

func (e *Error) Error() string

Error returns a string for the error and statistifes the error interface

type Flag Uses

type Flag bool

Flag is a hacky type for checking if an attribute is present

func (*Flag) MarshalXMLAttr Uses

func (f *Flag) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

MarshalXMLAttr : Do not use

func (*Flag) UnmarshalXMLAttr Uses

func (f *Flag) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr sets Flag to true if the attribute is present

type JottaDevice Uses

type JottaDevice struct {
    Name        string            `xml:"name"`
    DisplayName string            `xml:"display_name"`
    Type        string            `xml:"type"`
    Sid         string            `xml:"sid"`
    Size        int64             `xml:"size"`
    User        string            `xml:"user"`
    MountPoints []JottaMountPoint `xml:"mountPoints>mountPoint"`

JottaDevice represents a Jottacloud Device

type JottaFile Uses

type JottaFile struct {
    XMLName         xml.Name
    Name            string `xml:"name,attr"`
    Deleted         Flag   `xml:"deleted,attr"`
    PublicSharePath string `xml:"publicSharePath"`
    State           string `xml:"currentRevision>state"`
    CreatedAt       Time   `xml:"currentRevision>created"`
    ModifiedAt      Time   `xml:"currentRevision>modified"`
    Updated         Time   `xml:"currentRevision>updated"`
    Size            int64  `xml:"currentRevision>size"`
    MimeType        string `xml:"currentRevision>mime"`
    MD5             string `xml:"currentRevision>md5"`

JottaFile represents a Jottacloud file

type JottaFolder Uses

type JottaFolder struct {
    XMLName    xml.Name
    Name       string        `xml:"name,attr"`
    Deleted    Flag          `xml:"deleted,attr"`
    Path       string        `xml:"path"`
    CreatedAt  Time          `xml:"created"`
    ModifiedAt Time          `xml:"modified"`
    Updated    Time          `xml:"updated"`
    Folders    []JottaFolder `xml:"folders>folder"`
    Files      []JottaFile   `xml:"files>file"`

JottaFolder represents a JottacloudFolder

type JottaMountPoint Uses

type JottaMountPoint struct {
    Name    string        `xml:"name"`
    Size    int64         `xml:"size"`
    Device  string        `xml:"device"`
    Folders []JottaFolder `xml:"folders>folder"`
    Files   []JottaFile   `xml:"files>file"`

JottaMountPoint represents a Jottacloud mountpoint

type Time Uses

type Time time.Time

Time represents time values in the Jottacloud API. It uses a custom RFC3339 like format.

func (Time) APIString Uses

func (t Time) APIString() string

APIString returns Time string in Jottacloud API format

func (*Time) MarshalXML Uses

func (t *Time) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML turns a Time into XML

func (Time) String Uses

func (t Time) String() string

Return Time string in Jottacloud format

func (*Time) UnmarshalXML Uses

func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML turns XML into a Time

type TokenJSON Uses

type TokenJSON struct {
    AccessToken  string `json:"access_token"`
    TokenType    string `json:"token_type"`
    RefreshToken string `json:"refresh_token"`
    ExpiresIn    int32  `json:"expires_in"` // at least PayPal returns string, while most return number

TokenJSON is the struct representing the HTTP response from OAuth2 providers returning a token in JSON form.

type UploadResponse Uses

type UploadResponse struct {
    Name      string      `json:"name"`
    Path      string      `json:"path"`
    Kind      string      `json:"kind"`
    ContentID string      `json:"content_id"`
    Bytes     int64       `json:"bytes"`
    Md5       string      `json:"md5"`
    Created   int64       `json:"created"`
    Modified  int64       `json:"modified"`
    Deleted   interface{} `json:"deleted"`
    Mime      string      `json:"mime"`

UploadResponse after an upload

Package api imports 4 packages (graph) and is imported by 2 packages. Updated 2019-09-03. Refresh now. Tools for package owners.