Documentation ¶
Index ¶
- func MultistatusResponse(ctx context.Context, pf *XML, mds []*provider.ResourceInfo, ...) ([]byte, error)
- type GetGatewayServiceClientFunc
- type Handler
- type MultiStatusResponseUnmarshalXML
- type MultiStatusResponseXML
- type Props
- type PropstatUnmarshalXML
- type PropstatXML
- type ResponseUnmarshalXML
- type ResponseXML
- type XML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GetGatewayServiceClientFunc ¶
type GetGatewayServiceClientFunc func() (gateway.GatewayAPIClient, error)
GetGatewayServiceClientFunc is a callback used to pass in a StorageProviderClient during testing
type Handler ¶
type Handler struct { PublicURL string // contains filtered or unexported fields }
Handler handles propfind requests
func NewHandler ¶
func NewHandler(publicURL string, getClientFunc GetGatewayServiceClientFunc) *Handler
NewHandler returns a new PropfindHandler instance
func (*Handler) HandlePathPropfind ¶
HandlePathPropfind handles a path based propfind request ns is the namespace that is prefixed to the path in the cs3 namespace
func (*Handler) HandleSpacesPropfind ¶
HandleSpacesPropfind handles a spaces based propfind request
type MultiStatusResponseUnmarshalXML ¶
type MultiStatusResponseUnmarshalXML struct { XMLName xml.Name `xml:"multistatus"` XmlnsS string `xml:"xmlns:s,attr,omitempty"` XmlnsD string `xml:"xmlns:d,attr,omitempty"` XmlnsOC string `xml:"xmlns:oc,attr,omitempty"` Responses []*ResponseUnmarshalXML `xml:"response"` }
MultiStatusResponseUnmarshalXML is a workaround for https://github.com/golang/go/issues/13400
type MultiStatusResponseXML ¶
type MultiStatusResponseXML struct { XMLName xml.Name `xml:"d:multistatus"` XmlnsS string `xml:"xmlns:s,attr,omitempty"` XmlnsD string `xml:"xmlns:d,attr,omitempty"` XmlnsOC string `xml:"xmlns:oc,attr,omitempty"` Responses []*ResponseXML `xml:"d:response"` }
MultiStatusResponseXML holds the xml representation of a multistatus propfind response
func NewMultiStatusResponseXML ¶
func NewMultiStatusResponseXML() *MultiStatusResponseXML
NewMultiStatusResponseXML returns a preconfigured instance of MultiStatusResponseXML
type Props ¶
Props represents properties related to a resource http://www.webdav.org/specs/rfc4918.html#ELEMENT_prop (for propfind)
func (*Props) UnmarshalXML ¶
UnmarshalXML appends the property names enclosed within start to pn.
It returns an error if start does not contain any properties or if properties contain values. Character data between properties is ignored.
type PropstatUnmarshalXML ¶
type PropstatUnmarshalXML struct { // Prop requires DAV: to be the default namespace in the enclosing // XML. This is due to the standard encoding/xml package currently // not honoring namespace declarations inside a xmltag with a // parent element for anonymous slice elements. // Use of multistatusWriter takes care of this. Prop []*prop.PropertyXML `xml:"prop"` Status string `xml:"status"` Error *errors.ErrorXML `xml:"d:error"` ResponseDescription string `xml:"responsedescription,omitempty"` }
PropstatUnmarshalXML is a workaround for https://github.com/golang/go/issues/13400
type PropstatXML ¶
type PropstatXML struct { // Prop requires DAV: to be the default namespace in the enclosing // XML. This is due to the standard encoding/xml package currently // not honoring namespace declarations inside a xmltag with a // parent element for anonymous slice elements. // Use of multistatusWriter takes care of this. Prop []prop.PropertyXML `xml:"d:prop>_ignored_"` Status string `xml:"d:status"` Error *errors.ErrorXML `xml:"d:error"` ResponseDescription string `xml:"d:responsedescription,omitempty"` }
PropstatXML holds the xml representation of a propfind response http://www.webdav.org/specs/rfc4918.html#ELEMENT_propstat
type ResponseUnmarshalXML ¶
type ResponseUnmarshalXML struct { XMLName xml.Name `xml:"response"` Href string `xml:"href"` Propstat []PropstatUnmarshalXML `xml:"propstat"` Status string `xml:"status,omitempty"` Error *errors.ErrorXML `xml:"d:error"` ResponseDescription string `xml:"responsedescription,omitempty"` }
ResponseUnmarshalXML is a workaround for https://github.com/golang/go/issues/13400
type ResponseXML ¶
type ResponseXML struct { XMLName xml.Name `xml:"d:response"` Href string `xml:"d:href"` Propstat []PropstatXML `xml:"d:propstat"` Status string `xml:"d:status,omitempty"` Error *errors.ErrorXML `xml:"d:error"` ResponseDescription string `xml:"d:responsedescription,omitempty"` }
ResponseXML holds the xml representation of a propfind response
type XML ¶
type XML struct { XMLName xml.Name `xml:"DAV: propfind"` Allprop *struct{} `xml:"DAV: allprop"` Propname *struct{} `xml:"DAV: propname"` Prop Props `xml:"DAV: prop"` Include Props `xml:"DAV: include"` }
XML holds the xml representation of a propfind http://www.webdav.org/specs/rfc4918.html#ELEMENT_propfind
func ReadPropfind ¶
ReadPropfind extracts and parses the propfind XML information from a Reader from https://github.com/golang/net/blob/e514e69ffb8bc3c76a71ae40de0118d794855992/webdav/xml.go#L178-L205