api

package
v0.0.0-...-1b1593a Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package api has type definitions for webdav

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

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

Error is used to desribe webdav errors

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

<s:exception>Sabre\DAV\Exception\NotFound</s:exception>
<s:message>File with name Photo could not be located</s:message>

</d:error>

func (*Error) Error

func (e *Error) Error() string

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

type Multistatus

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

Multistatus contains responses returned from an HTTP 207 return code

type Prop

type Prop struct {
	Status   string    `xml:"DAV: status"`
	Name     string    `xml:"DAV: prop>displayname,omitempty"`
	Type     *xml.Name `xml:"DAV: prop>resourcetype>collection,omitempty"`
	Size     int64     `xml:"DAV: prop>getcontentlength,omitempty"`
	Modified Time      `xml:"DAV: prop>getlastmodified,omitempty"`
}

Prop is the properties of a response

func (*Prop) StatusOK

func (p *Prop) StatusOK() bool

StatusOK examines the Status and returns an OK flag

type PropValue

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

PropValue is a tagged name and value

type Response

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

Response contains an Href the response it about and its properties

type Time

type Time time.Time

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

func (*Time) MarshalXML

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

MarshalXML turns a Time into XML

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