mirror of
https://github.com/openziti/zrok.git
synced 2024-11-26 01:54:09 +01:00
endpoints/drive/webdav -> endpoints/drive/driveServer (#511)
This commit is contained in:
parent
a28aa2f77f
commit
8ccb5603ca
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/openziti/sdk-golang/ziti"
|
"github.com/openziti/sdk-golang/ziti"
|
||||||
"github.com/openziti/sdk-golang/ziti/edge"
|
"github.com/openziti/sdk-golang/ziti/edge"
|
||||||
"github.com/openziti/zrok/endpoints"
|
"github.com/openziti/zrok/endpoints"
|
||||||
"github.com/openziti/zrok/endpoints/drive/webdav"
|
"github.com/openziti/zrok/endpoints/drive/driveServer"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
@ -43,9 +43,9 @@ func NewBackend(cfg *BackendConfig) (*Backend, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
handler := &webdav.Handler{
|
handler := &driveServer.Handler{
|
||||||
FileSystem: webdav.Dir(cfg.DriveRoot),
|
FileSystem: driveServer.Dir(cfg.DriveRoot),
|
||||||
LockSystem: webdav.NewMemLS(),
|
LockSystem: driveServer.NewMemLS(),
|
||||||
Logger: func(r *http.Request, err error) {
|
Logger: func(r *http.Request, err error) {
|
||||||
if cfg.Requests != nil {
|
if cfg.Requests != nil {
|
||||||
cfg.Requests <- &endpoints.Request{
|
cfg.Requests <- &endpoints.Request{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
// The If header is covered by Section 10.4.
|
// The If header is covered by Section 10.4.
|
||||||
// http://www.webdav.org/specs/rfc4918.html#HEADER_If
|
// http://www.webdav.org/specs/rfc4918.html#HEADER_If
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
@ -21,7 +21,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/openziti/zrok/endpoints/drive/webdav"
|
"github.com/openziti/zrok/endpoints/drive/driveServer"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
@ -32,9 +32,9 @@ var port = flag.Int("port", 9999, "server port")
|
|||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
log.SetFlags(0)
|
log.SetFlags(0)
|
||||||
h := &webdav.Handler{
|
h := &driveServer.Handler{
|
||||||
FileSystem: webdav.NewMemFS(),
|
FileSystem: driveServer.NewMemFS(),
|
||||||
LockSystem: webdav.NewMemLS(),
|
LockSystem: driveServer.NewMemLS(),
|
||||||
Logger: func(r *http.Request, err error) {
|
Logger: func(r *http.Request, err error) {
|
||||||
litmus := r.Header.Get("X-Litmus")
|
litmus := r.Header.Get("X-Litmus")
|
||||||
if len(litmus) > 19 {
|
if len(litmus) > 19 {
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"container/heap"
|
"container/heap"
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -2,8 +2,8 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// Package webdav provides a WebDAV server implementation.
|
// Package driveServer provides a WebDAV server implementation.
|
||||||
package webdav // import "golang.org/x/net/webdav"
|
package driveServer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
// The XML encoding is covered by Section 14.
|
// The XML encoding is covered by Section 14.
|
||||||
// http://www.webdav.org/specs/rfc4918.html#xml.element.definitions
|
// http://www.webdav.org/specs/rfc4918.html#xml.element.definitions
|
||||||
@ -32,7 +32,7 @@ import (
|
|||||||
// In the long term, this package should use the standard library's version
|
// In the long term, this package should use the standard library's version
|
||||||
// only, and the internal fork deleted, once
|
// only, and the internal fork deleted, once
|
||||||
// https://github.com/golang/go/issues/13400 is resolved.
|
// https://github.com/golang/go/issues/13400 is resolved.
|
||||||
ixml "github.com/openziti/zrok/endpoints/drive/webdav/internal/xml"
|
ixml "github.com/openziti/zrok/endpoints/drive/driveServer/internal/xml"
|
||||||
)
|
)
|
||||||
|
|
||||||
// http://www.webdav.org/specs/rfc4918.html#ELEMENT_lockinfo
|
// http://www.webdav.org/specs/rfc4918.html#ELEMENT_lockinfo
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package webdav
|
package driveServer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@ -16,7 +16,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
ixml "github.com/openziti/zrok/endpoints/drive/webdav/internal/xml"
|
ixml "github.com/openziti/zrok/endpoints/drive/driveServer/internal/xml"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestReadLockInfo(t *testing.T) {
|
func TestReadLockInfo(t *testing.T) {
|
@ -3,7 +3,7 @@ package sync
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/openziti/zrok/endpoints/drive/webdav"
|
"github.com/openziti/zrok/endpoints/drive/driveServer"
|
||||||
"io"
|
"io"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
@ -59,7 +59,7 @@ func (t *FilesystemTarget) recurse(path string, d fs.DirEntry, err error) error
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
etag := ""
|
etag := ""
|
||||||
if v, ok := fi.(webdav.ETager); ok {
|
if v, ok := fi.(driveServer.ETager); ok {
|
||||||
etag, err = v.ETag(context.Background())
|
etag, err = v.ETag(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user