Change to trace and make a deploy for tickle
parent
1411171107
commit
599d52cf8d
|
|
@ -1 +1,2 @@
|
||||||
**/*.sw*
|
**/*.sw*
|
||||||
|
dndex
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
cd "$(dirname "$BASH_SOURCE")"
|
||||||
|
set -e
|
||||||
|
GOOS=linux GOARCH=arm GOARM=5 CGO_ENABLED=0 go build -o $(basename "$PWD") -a -installsuffix cgo
|
||||||
|
scp ./dndex zach@192.168.1.123:./dndex/dndex.new
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$0" == "$BASH_SOURCE" ]; then
|
||||||
|
main "$@"
|
||||||
|
fi
|
||||||
|
|
@ -34,8 +34,8 @@ func who(g storage.Graph, w http.ResponseWriter, r *http.Request) error {
|
||||||
return whoDelete(namespace, g, w, r)
|
return whoDelete(namespace, g, w, r)
|
||||||
case http.MethodPatch:
|
case http.MethodPatch:
|
||||||
return whoPatch(namespace, g, w, r)
|
return whoPatch(namespace, g, w, r)
|
||||||
case http.MethodHead:
|
case http.MethodTrace:
|
||||||
return whoHead(namespace, g, w, r)
|
return whoTrace(namespace, g, w, r)
|
||||||
default:
|
default:
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -183,7 +183,7 @@ func whoPatch(namespace string, g storage.Graph, w http.ResponseWriter, r *http.
|
||||||
return whoGet(namespace, g, w, r)
|
return whoGet(namespace, g, w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func whoHead(namespace string, g storage.Graph, w http.ResponseWriter, r *http.Request) error {
|
func whoTrace(namespace string, g storage.Graph, w http.ResponseWriter, r *http.Request) error {
|
||||||
ones, err := g.List(r.Context(), namespace)
|
ones, err := g.List(r.Context(), namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -227,8 +227,8 @@ func TestWho(t *testing.T) {
|
||||||
t.Logf("%s", w.Body.Bytes())
|
t.Logf("%s", w.Body.Bytes())
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("head fake", func(t *testing.T) {
|
t.Run("trace fake", func(t *testing.T) {
|
||||||
r := httptest.NewRequest(http.MethodHead, "/who/notcol", nil)
|
r := httptest.NewRequest(http.MethodTrace, "/who/notcol", nil)
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
handler.ServeHTTP(w, r)
|
handler.ServeHTTP(w, r)
|
||||||
if w.Code != http.StatusOK {
|
if w.Code != http.StatusOK {
|
||||||
|
|
@ -236,8 +236,8 @@ func TestWho(t *testing.T) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("head real", func(t *testing.T) {
|
t.Run("trace real", func(t *testing.T) {
|
||||||
r := httptest.NewRequest(http.MethodHead, "/who/col", nil)
|
r := httptest.NewRequest(http.MethodTrace, "/who/col", nil)
|
||||||
w := httptest.NewRecorder()
|
w := httptest.NewRecorder()
|
||||||
handler.ServeHTTP(w, r)
|
handler.ServeHTTP(w, r)
|
||||||
if w.Code != http.StatusOK {
|
if w.Code != http.StatusOK {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue