Skip to content

Commit

Permalink
improve naming of prop package
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas committed Apr 4, 2022
1 parent 72cd2e8 commit 2b44d0f
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 158 deletions.
6 changes: 3 additions & 3 deletions internal/http/services/owncloud/ocdav/locks.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
"github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/errors"
"github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/net"
"github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/props"
"github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/prop"
"github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/spacelookup"
"github.com/cs3org/reva/v2/pkg/appctx"
ctxpkg "github.com/cs3org/reva/v2/pkg/ctx"
Expand Down Expand Up @@ -557,10 +557,10 @@ func writeLockInfo(w io.Writer, token string, ld LockDetails) (int, error) {
lockdiscovery.WriteString(" <d:timeout>Infinite</d:timeout>\n")
}
if token != "" {
lockdiscovery.WriteString(fmt.Sprintf(" <d:locktoken><d:href>%s</d:href></d:locktoken>\n", props.Escape(token)))
lockdiscovery.WriteString(fmt.Sprintf(" <d:locktoken><d:href>%s</d:href></d:locktoken>\n", prop.Escape(token)))
}
if href != "" {
lockdiscovery.WriteString(fmt.Sprintf(" <d:lockroot><d:href>%s</d:href></d:lockroot>\n", props.Escape(href)))
lockdiscovery.WriteString(fmt.Sprintf(" <d:lockroot><d:href>%s</d:href></d:lockroot>\n", prop.Escape(href)))
}
lockdiscovery.WriteString("</d:activelock></d:lockdiscovery></d:prop>")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

package props
package prop

import (
"bytes"
Expand Down Expand Up @@ -49,44 +49,44 @@ func xmlEscaped(val string) []byte {
return buf.Bytes()
}

// NewPropNS returns a new PropertyXML instance
func NewPropNS(namespace string, local string, val string) PropertyXML {
// EscapedNS returns a new PropertyXML instance while xml-escaping the value
func EscapedNS(namespace string, local string, val string) PropertyXML {
return PropertyXML{
XMLName: xml.Name{Space: namespace, Local: local},
Lang: "",
InnerXML: xmlEscaped(val),
}
}

// NewProp returns a new PropertyXML instance while xml-escaping the value
// Escaped returns a new PropertyXML instance while xml-escaping the value
// TODO properly use the space
func NewProp(key, val string) PropertyXML {
func Escaped(key, val string) PropertyXML {
return PropertyXML{
XMLName: xml.Name{Space: "", Local: key},
Lang: "",
InnerXML: xmlEscaped(val),
}
}

// NewNotFound returns a new PropertyXML instance with an empty value
func NewNotFound(key string) PropertyXML {
// NotFound returns a new PropertyXML instance with an empty value
func NotFound(key string) PropertyXML {
return PropertyXML{
XMLName: xml.Name{Space: "", Local: key},
Lang: "",
}
}

// NewNotFound returns a new PropertyXML instance with the given namespace and an empty value
func NewNotFoundNS(namespace, key string) PropertyXML {
// NotFoundNS returns a new PropertyXML instance with the given namespace and an empty value
func NotFoundNS(namespace, key string) PropertyXML {
return PropertyXML{
XMLName: xml.Name{Space: namespace, Local: key},
Lang: "",
}
}

// NewPropRaw returns a new PropertyXML instance for the given key/value pair
// Raw returns a new PropertyXML instance for the given key/value pair
// TODO properly use the space
func NewPropRaw(key, val string) PropertyXML {
func Raw(key, val string) PropertyXML {
return PropertyXML{
XMLName: xml.Name{Space: "", Local: key},
Lang: "",
Expand Down
Loading

0 comments on commit 2b44d0f

Please sign in to comment.