diff options
author | Maciej Wereski <m.wereski@partner.samsung.com> | 2018-07-13 16:46:15 +0200 |
---|---|---|
committer | Maciej Wereski <m.wereski@partner.samsung.com> | 2018-09-05 14:24:58 +0200 |
commit | 7f48124ddcec310cc44488b20055fa41f04f2a1d (patch) | |
tree | 4027d83bd2ea88ff177f12450c8fc441b3219593 /http/server/api/v1/handlers.go | |
parent | e50de051fc526e2d68698fd3abd39725a72bd7f8 (diff) | |
download | boruta-7f48124ddcec310cc44488b20055fa41f04f2a1d.tar.gz boruta-7f48124ddcec310cc44488b20055fa41f04f2a1d.tar.bz2 boruta-7f48124ddcec310cc44488b20055fa41f04f2a1d.zip |
Get rid of dot imports of boruta package
Using dot imports should be avoided. Such imports were left only in some
tests.
Change-Id: I1d4db1e2b89e2fd8475c8c657ea72b70bba32c5b
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
Diffstat (limited to 'http/server/api/v1/handlers.go')
-rw-r--r-- | http/server/api/v1/handlers.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/http/server/api/v1/handlers.go b/http/server/api/v1/handlers.go index f1295e5..18ecf8f 100644 --- a/http/server/api/v1/handlers.go +++ b/http/server/api/v1/handlers.go @@ -26,14 +26,14 @@ import ( "net" "net/http" - . "git.tizen.org/tools/boruta" + "git.tizen.org/tools/boruta" util "git.tizen.org/tools/boruta/http" ) // newRequestHandler parses HTTP request for creating new Boruta request and // calls NewRequest(). func (api *API) newRequestHandler(r *http.Request, ps map[string]string) responseData { - var newReq ReqInfo + var newReq boruta.ReqInfo defer r.Body.Close() if err := json.NewDecoder(r.Body).Decode(&newReq); err != nil { @@ -41,7 +41,7 @@ func (api *API) newRequestHandler(r *http.Request, ps map[string]string) respons } //FIXME: currently UserInfo is ignored. Change when user support is added. - rid, err := api.reqs.NewRequest(newReq.Caps, newReq.Priority, UserInfo{}, + rid, err := api.reqs.NewRequest(newReq.Caps, newReq.Priority, boruta.UserInfo{}, newReq.ValidAfter.UTC(), newReq.Deadline.UTC()) if err != nil { return util.NewServerError(err) @@ -74,7 +74,7 @@ func (api *API) updateRequestHandler(r *http.Request, ps map[string]string) resp return util.NewServerError(util.ErrBadID) } - var req ReqInfo + var req boruta.ReqInfo if err = json.NewDecoder(r.Body).Decode(&req); err != nil { return util.NewServerError(err) } @@ -198,7 +198,7 @@ func (api *API) getWorkerInfoHandler(r *http.Request, ps map[string]string) resp return util.NewServerError(util.ErrBadUUID) } - workerinfo, err := api.workers.GetWorkerInfo(WorkerUUID(ps["id"])) + workerinfo, err := api.workers.GetWorkerInfo(boruta.WorkerUUID(ps["id"])) if err != nil { return util.NewServerError(err) } @@ -220,14 +220,14 @@ func (api *API) setWorkerStateHandler(r *http.Request, ps map[string]string) res return util.NewServerError(err) } - return util.NewServerError(api.workers.SetState(WorkerUUID(ps["id"]), + return util.NewServerError(api.workers.SetState(boruta.WorkerUUID(ps["id"]), state.WorkerState)) } // setWorkerGroupsHandler parses HTTP workers for setting worker groups and calls // workers.SetGroups(). func (api *API) setWorkerGroupsHandler(r *http.Request, ps map[string]string) responseData { - var groups Groups + var groups boruta.Groups defer r.Body.Close() if !isValidUUID(ps["id"]) { @@ -237,7 +237,7 @@ func (api *API) setWorkerGroupsHandler(r *http.Request, ps map[string]string) re if err := json.NewDecoder(r.Body).Decode(&groups); err != nil { return util.NewServerError(err) } - return util.NewServerError(api.workers.SetGroups(WorkerUUID(ps["id"]), groups)) + return util.NewServerError(api.workers.SetGroups(boruta.WorkerUUID(ps["id"]), groups)) } // workerDeregister parses HTTP workers for deregistering worker state and calls @@ -249,5 +249,5 @@ func (api *API) workerDeregister(r *http.Request, ps map[string]string) response return util.NewServerError(util.ErrBadUUID) } - return util.NewServerError(api.workers.Deregister(WorkerUUID(ps["id"]))) + return util.NewServerError(api.workers.Deregister(boruta.WorkerUUID(ps["id"]))) } |