Skip to content

Commit

Permalink
Update mod/lock versioning.
Browse files Browse the repository at this point in the history
  • Loading branch information
benbjohnson committed Dec 5, 2013
1 parent 5d865e3 commit b784ced
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions mod/lock/v2/tests/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,25 +164,25 @@ func TestModLockRenew(t *testing.T) {


func testAcquireLock(s *server.Server, key string, ttl int) (string, error) {
resp, err := tests.PostForm(fmt.Sprintf("%s/mod/lock/v2/%s?ttl=%d", s.URL(), key, ttl), nil)
resp, err := tests.PostForm(fmt.Sprintf("%s/mod/v2/lock/%s?ttl=%d", s.URL(), key, ttl), nil)
ret := tests.ReadBody(resp)
return string(ret), err
}

func testGetLockIndex(s *server.Server, key string) (string, error) {
resp, err := tests.Get(fmt.Sprintf("%s/mod/lock/v2/%s", s.URL(), key))
resp, err := tests.Get(fmt.Sprintf("%s/mod/v2/lock/%s", s.URL(), key))
ret := tests.ReadBody(resp)
return string(ret), err
}

func testReleaseLock(s *server.Server, key string, index int) (string, error) {
resp, err := tests.DeleteForm(fmt.Sprintf("%s/mod/lock/v2/%s/%d", s.URL(), key, index), nil)
resp, err := tests.DeleteForm(fmt.Sprintf("%s/mod/v2/lock/%s/%d", s.URL(), key, index), nil)
ret := tests.ReadBody(resp)
return string(ret), err
}

func testRenewLock(s *server.Server, key string, index int, ttl int) (string, error) {
resp, err := tests.PutForm(fmt.Sprintf("%s/mod/lock/v2/%s/%d?ttl=%d", s.URL(), key, index, ttl), nil)
resp, err := tests.PutForm(fmt.Sprintf("%s/mod/v2/lock/%s/%d?ttl=%d", s.URL(), key, index, ttl), nil)
ret := tests.ReadBody(resp)
return string(ret), err
}
2 changes: 1 addition & 1 deletion mod/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ func HttpHandler(addr string) http.Handler {
r.PathPrefix("/dashboard/").Handler(http.StripPrefix("/dashboard/", dashboard.HttpHandler()))

// TODO: Use correct addr.
r.PathPrefix("/lock/v2").Handler(http.StripPrefix("/lock/v2", lock2.NewHandler(addr)))
r.PathPrefix("/v2/lock").Handler(http.StripPrefix("/v2/lock", lock2.NewHandler(addr)))
return r
}

0 comments on commit b784ced

Please sign in to comment.