rclone: github.com/ncw/rclone/backend/webdav/api Index | Files

package api

import "github.com/ncw/rclone/backend/webdav/api"

Package api has type definitions for webdav


Package Files


type Error Uses

type Error struct {
    Exception  string `xml:"exception,omitempty"`
    Message    string `xml:"message,omitempty"`
    Status     string
    StatusCode int

Error is used to describe webdav errors

<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">

<s:message>File with name Photo could not be located</s:message>


func (*Error) Error Uses

func (e *Error) Error() string

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

type Multistatus Uses

type Multistatus struct {
    Responses []Response `xml:"response"`

Multistatus contains responses returned from an HTTP 207 return code

type Prop Uses

type Prop struct {
    Status       []string  `xml:"DAV: status"`
    Name         string    `xml:"DAV: prop>displayname,omitempty"`
    Type         *xml.Name `xml:"DAV: prop>resourcetype>collection,omitempty"`
    IsCollection *string   `xml:"DAV: prop>iscollection,omitempty"` // this is a Microsoft extension see #2716
    Size         int64     `xml:"DAV: prop>getcontentlength,omitempty"`
    Modified     Time      `xml:"DAV: prop>getlastmodified,omitempty"`
    Checksums    []string  `xml:"prop>checksums>checksum,omitempty"`

Prop is the properties of a response

This is a lazy way of decoding the multiple <s:propstat> in the response.

The response might look like this


    <d:getlastmodified>Tue, 19 Dec 2017 22:02:36 GMT</d:getlastmodified>
  <d:status>HTTP/1.1 200 OK</d:status>
  <d:status>HTTP/1.1 404 Not Found</d:status>


So we elide the array of <d:propstat> and within that the array of <d:prop> into one struct.

Note that status collects all the status values for which we just check the first is OK.

func (*Prop) Hashes Uses

func (p *Prop) Hashes() (hashes map[hash.Type]string)

Hashes returns a map of all checksums - may be nil

func (*Prop) StatusOK Uses

func (p *Prop) StatusOK() bool

StatusOK examines the Status and returns an OK flag

type PropValue Uses

type PropValue struct {
    XMLName xml.Name `xml:""`
    Value   string   `xml:",chardata"`

PropValue is a tagged name and value

type Quota Uses

type Quota struct {
    Available string `xml:"DAV: response>propstat>prop>quota-available-bytes"`
    Used      string `xml:"DAV: response>propstat>prop>quota-used-bytes"`

Quota is used to read the bytes used and available

<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">

  <d:status>HTTP/1.1 200 OK</d:status>


type Response Uses

type Response struct {
    Href  string `xml:"href"`
    Props Prop   `xml:"propstat"`

Response contains an Href the response it about and its properties

type Time Uses

type Time time.Time

Time represents date and time information for the webdav API marshalling to and from timeFormat

func (*Time) MarshalXML Uses

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

MarshalXML turns a Time into XML

func (*Time) UnmarshalXML Uses

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

UnmarshalXML turns XML into a Time

Package api imports 8 packages (graph) and is imported by 2 packages. Updated 2020-08-03. Refresh now. Tools for package owners.