Add prometheus endpoint for getting metrics (#33)
This commit is contained in:
3
vendor/golang.org/x/net/webdav/file.go
generated
vendored
3
vendor/golang.org/x/net/webdav/file.go
generated
vendored
@ -5,6 +5,7 @@
|
||||
package webdav
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/xml"
|
||||
"io"
|
||||
"net/http"
|
||||
@ -14,8 +15,6 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// slashClean is equivalent to but slightly more efficient than
|
||||
|
17
vendor/golang.org/x/net/webdav/file_go1.6.go
generated
vendored
17
vendor/golang.org/x/net/webdav/file_go1.6.go
generated
vendored
@ -1,17 +0,0 @@
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !go1.7
|
||||
|
||||
package webdav
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func getContext(r *http.Request) context.Context {
|
||||
return context.Background()
|
||||
}
|
16
vendor/golang.org/x/net/webdav/file_go1.7.go
generated
vendored
16
vendor/golang.org/x/net/webdav/file_go1.7.go
generated
vendored
@ -1,16 +0,0 @@
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build go1.7
|
||||
|
||||
package webdav
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func getContext(r *http.Request) context.Context {
|
||||
return r.Context()
|
||||
}
|
3
vendor/golang.org/x/net/webdav/prop.go
generated
vendored
3
vendor/golang.org/x/net/webdav/prop.go
generated
vendored
@ -6,6 +6,7 @@ package webdav
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
@ -15,8 +16,6 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// Proppatch describes a property update instruction as defined in RFC 4918.
|
||||
|
18
vendor/golang.org/x/net/webdav/webdav.go
generated
vendored
18
vendor/golang.org/x/net/webdav/webdav.go
generated
vendored
@ -174,7 +174,7 @@ func (h *Handler) handleOptions(w http.ResponseWriter, r *http.Request) (status
|
||||
if err != nil {
|
||||
return status, err
|
||||
}
|
||||
ctx := getContext(r)
|
||||
ctx := r.Context()
|
||||
allow := "OPTIONS, LOCK, PUT, MKCOL"
|
||||
if fi, err := h.FileSystem.Stat(ctx, reqPath); err == nil {
|
||||
if fi.IsDir() {
|
||||
@ -197,7 +197,7 @@ func (h *Handler) handleGetHeadPost(w http.ResponseWriter, r *http.Request) (sta
|
||||
return status, err
|
||||
}
|
||||
// TODO: check locks for read-only access??
|
||||
ctx := getContext(r)
|
||||
ctx := r.Context()
|
||||
f, err := h.FileSystem.OpenFile(ctx, reqPath, os.O_RDONLY, 0)
|
||||
if err != nil {
|
||||
return http.StatusNotFound, err
|
||||
@ -231,7 +231,7 @@ func (h *Handler) handleDelete(w http.ResponseWriter, r *http.Request) (status i
|
||||
}
|
||||
defer release()
|
||||
|
||||
ctx := getContext(r)
|
||||
ctx := r.Context()
|
||||
|
||||
// TODO: return MultiStatus where appropriate.
|
||||
|
||||
@ -262,7 +262,7 @@ func (h *Handler) handlePut(w http.ResponseWriter, r *http.Request) (status int,
|
||||
defer release()
|
||||
// TODO(rost): Support the If-Match, If-None-Match headers? See bradfitz'
|
||||
// comments in http.checkEtag.
|
||||
ctx := getContext(r)
|
||||
ctx := r.Context()
|
||||
|
||||
f, err := h.FileSystem.OpenFile(ctx, reqPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666)
|
||||
if err != nil {
|
||||
@ -300,7 +300,7 @@ func (h *Handler) handleMkcol(w http.ResponseWriter, r *http.Request) (status in
|
||||
}
|
||||
defer release()
|
||||
|
||||
ctx := getContext(r)
|
||||
ctx := r.Context()
|
||||
|
||||
if r.ContentLength > 0 {
|
||||
return http.StatusUnsupportedMediaType, nil
|
||||
@ -344,7 +344,7 @@ func (h *Handler) handleCopyMove(w http.ResponseWriter, r *http.Request) (status
|
||||
return http.StatusForbidden, errDestinationEqualsSource
|
||||
}
|
||||
|
||||
ctx := getContext(r)
|
||||
ctx := r.Context()
|
||||
|
||||
if r.Method == "COPY" {
|
||||
// Section 7.5.1 says that a COPY only needs to lock the destination,
|
||||
@ -399,7 +399,7 @@ func (h *Handler) handleLock(w http.ResponseWriter, r *http.Request) (retStatus
|
||||
return status, err
|
||||
}
|
||||
|
||||
ctx := getContext(r)
|
||||
ctx := r.Context()
|
||||
token, ld, now, created := "", LockDetails{}, time.Now(), false
|
||||
if li == (lockInfo{}) {
|
||||
// An empty lockInfo means to refresh the lock.
|
||||
@ -511,7 +511,7 @@ func (h *Handler) handlePropfind(w http.ResponseWriter, r *http.Request) (status
|
||||
if err != nil {
|
||||
return status, err
|
||||
}
|
||||
ctx := getContext(r)
|
||||
ctx := r.Context()
|
||||
fi, err := h.FileSystem.Stat(ctx, reqPath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
@ -581,7 +581,7 @@ func (h *Handler) handleProppatch(w http.ResponseWriter, r *http.Request) (statu
|
||||
}
|
||||
defer release()
|
||||
|
||||
ctx := getContext(r)
|
||||
ctx := r.Context()
|
||||
|
||||
if _, err := h.FileSystem.Stat(ctx, reqPath); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
|
Reference in New Issue
Block a user