api

package
v1.43.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountInfo

type AccountInfo 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"`
}

AccountInfo represents a Jottacloud account

type Error

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

func (e *Error) Error() string

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

type Flag

type Flag bool

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

func (*Flag) MarshalXMLAttr

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

MarshalXMLAttr : Do not use

func (*Flag) UnmarshalXMLAttr

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

UnmarshalXMLAttr sets Flag to true if the attribute is present

type JottaDevice

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

type JottaFile struct {
	XMLName    xml.Name
	Name       string `xml:"name,attr"`
	Deleted    Flag   `xml:"deleted,attr"`
	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

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

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

type Time time.Time

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

func (*Time) MarshalXML

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

MarshalXML turns a Time into XML

func (Time) String

func (t Time) String() string

Return Time string in Jottacloud format

func (*Time) UnmarshalXML

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

UnmarshalXML turns XML into a Time

Jump to

Keyboard shortcuts

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