From 5660634c29e352cdb240ce6699567ec4949828c3 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 30 Apr 2015 21:08:42 -0700 Subject: [PATCH] refactor datastore structure for consistency --- AUTHORS | 10 ---------- datastore/bolt/agent.go | 1 - datastore/builtin/agent.go | 1 + datastore/{bolt => builtin}/bolt.go | 2 +- datastore/{bolt => builtin}/build.go | 2 +- datastore/{bolt => builtin}/build_test.go | 2 +- datastore/{bolt => builtin}/repo.go | 2 +- datastore/{bolt => builtin}/repo_test.go | 2 +- datastore/{bolt => builtin}/task.go | 2 +- datastore/{bolt => builtin}/task_test.go | 2 +- datastore/{bolt => builtin}/token.go | 2 +- datastore/{bolt => builtin}/token_test.go | 2 +- datastore/{bolt => builtin}/user.go | 2 +- datastore/{bolt => builtin}/user_test.go | 2 +- datastore/{bolt => builtin}/util.go | 2 +- datastore/{rpc => plugin}/build.go | 2 +- datastore/{rpc => plugin}/client.go | 2 +- datastore/{rpc => plugin}/repo.go | 2 +- datastore/{rpc => plugin}/task.go | 2 +- datastore/{rpc => plugin}/token.go | 2 +- datastore/{rpc => plugin}/user.go | 2 +- drone.go | 4 ++-- 22 files changed, 21 insertions(+), 31 deletions(-) delete mode 100644 AUTHORS delete mode 100644 datastore/bolt/agent.go create mode 100644 datastore/builtin/agent.go rename datastore/{bolt => builtin}/bolt.go (99%) rename datastore/{bolt => builtin}/build.go (99%) rename datastore/{bolt => builtin}/build_test.go (99%) rename datastore/{bolt => builtin}/repo.go (99%) rename datastore/{bolt => builtin}/repo_test.go (99%) rename datastore/{bolt => builtin}/task.go (98%) rename datastore/{bolt => builtin}/task_test.go (98%) rename datastore/{bolt => builtin}/token.go (99%) rename datastore/{bolt => builtin}/token_test.go (99%) rename datastore/{bolt => builtin}/user.go (99%) rename datastore/{bolt => builtin}/user_test.go (99%) rename datastore/{bolt => builtin}/util.go (99%) rename datastore/{rpc => plugin}/build.go (99%) rename datastore/{rpc => plugin}/client.go (96%) rename datastore/{rpc => plugin}/repo.go (99%) rename datastore/{rpc => plugin}/task.go (99%) rename datastore/{rpc => plugin}/token.go (97%) rename datastore/{rpc => plugin}/user.go (99%) diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index fb74bfa30..000000000 --- a/AUTHORS +++ /dev/null @@ -1,10 +0,0 @@ -# This file lists all individuals having contributed content to the repository. -# If you're submitting a patch, please add your name here in alphabetical order as part of the patch. - -Alex Suraci -Artur Rodrigues -Brad Rydzewski -Justin Keller -Martin Charles -Michael Nutt -Thomas Burke diff --git a/datastore/bolt/agent.go b/datastore/bolt/agent.go deleted file mode 100644 index a3ce8fd08..000000000 --- a/datastore/bolt/agent.go +++ /dev/null @@ -1 +0,0 @@ -package bolt diff --git a/datastore/builtin/agent.go b/datastore/builtin/agent.go new file mode 100644 index 000000000..5d9ee613f --- /dev/null +++ b/datastore/builtin/agent.go @@ -0,0 +1 @@ +package builtin diff --git a/datastore/bolt/bolt.go b/datastore/builtin/bolt.go similarity index 99% rename from datastore/bolt/bolt.go rename to datastore/builtin/bolt.go index 904e73a0f..ab225399b 100644 --- a/datastore/bolt/bolt.go +++ b/datastore/builtin/bolt.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "errors" diff --git a/datastore/bolt/build.go b/datastore/builtin/build.go similarity index 99% rename from datastore/bolt/build.go rename to datastore/builtin/build.go index 0623cfd8f..776fbc92c 100644 --- a/datastore/bolt/build.go +++ b/datastore/builtin/build.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "encoding/binary" diff --git a/datastore/bolt/build_test.go b/datastore/builtin/build_test.go similarity index 99% rename from datastore/bolt/build_test.go rename to datastore/builtin/build_test.go index c7dcc7676..8a417b0ee 100644 --- a/datastore/bolt/build_test.go +++ b/datastore/builtin/build_test.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "github.com/drone/drone/common" diff --git a/datastore/bolt/repo.go b/datastore/builtin/repo.go similarity index 99% rename from datastore/bolt/repo.go rename to datastore/builtin/repo.go index 1b0ed70d1..2ccee704c 100644 --- a/datastore/bolt/repo.go +++ b/datastore/builtin/repo.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "bytes" diff --git a/datastore/bolt/repo_test.go b/datastore/builtin/repo_test.go similarity index 99% rename from datastore/bolt/repo_test.go rename to datastore/builtin/repo_test.go index f1ae0cc5b..9b72d2b44 100644 --- a/datastore/bolt/repo_test.go +++ b/datastore/builtin/repo_test.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "github.com/drone/drone/common" diff --git a/datastore/bolt/task.go b/datastore/builtin/task.go similarity index 98% rename from datastore/bolt/task.go rename to datastore/builtin/task.go index ae23a8c39..366104043 100644 --- a/datastore/bolt/task.go +++ b/datastore/builtin/task.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "bytes" diff --git a/datastore/bolt/task_test.go b/datastore/builtin/task_test.go similarity index 98% rename from datastore/bolt/task_test.go rename to datastore/builtin/task_test.go index 8168e8cfd..92cb14c2e 100644 --- a/datastore/bolt/task_test.go +++ b/datastore/builtin/task_test.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "github.com/drone/drone/common" diff --git a/datastore/bolt/token.go b/datastore/builtin/token.go similarity index 99% rename from datastore/bolt/token.go rename to datastore/builtin/token.go index 20a610f14..5775aefb2 100644 --- a/datastore/bolt/token.go +++ b/datastore/builtin/token.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "github.com/boltdb/bolt" diff --git a/datastore/bolt/token_test.go b/datastore/builtin/token_test.go similarity index 99% rename from datastore/bolt/token_test.go rename to datastore/builtin/token_test.go index f910dd490..5afe57a86 100644 --- a/datastore/bolt/token_test.go +++ b/datastore/builtin/token_test.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "os" diff --git a/datastore/bolt/user.go b/datastore/builtin/user.go similarity index 99% rename from datastore/bolt/user.go rename to datastore/builtin/user.go index 38eb0d370..4c9c5b668 100644 --- a/datastore/bolt/user.go +++ b/datastore/builtin/user.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "time" diff --git a/datastore/bolt/user_test.go b/datastore/builtin/user_test.go similarity index 99% rename from datastore/bolt/user_test.go rename to datastore/builtin/user_test.go index de790bba8..2fbaab598 100644 --- a/datastore/bolt/user_test.go +++ b/datastore/builtin/user_test.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "os" diff --git a/datastore/bolt/util.go b/datastore/builtin/util.go similarity index 99% rename from datastore/bolt/util.go rename to datastore/builtin/util.go index c69d24877..b454f6061 100644 --- a/datastore/bolt/util.go +++ b/datastore/builtin/util.go @@ -1,4 +1,4 @@ -package bolt +package builtin import ( "bytes" diff --git a/datastore/rpc/build.go b/datastore/plugin/build.go similarity index 99% rename from datastore/rpc/build.go rename to datastore/plugin/build.go index 603d8ed1d..999ac8d55 100644 --- a/datastore/rpc/build.go +++ b/datastore/plugin/build.go @@ -1,4 +1,4 @@ -package rpc +package plugin import ( "time" diff --git a/datastore/rpc/client.go b/datastore/plugin/client.go similarity index 96% rename from datastore/rpc/client.go rename to datastore/plugin/client.go index 655508fb6..cb6109caa 100644 --- a/datastore/rpc/client.go +++ b/datastore/plugin/client.go @@ -1,4 +1,4 @@ -package rpc +package plugin import ( "net" diff --git a/datastore/rpc/repo.go b/datastore/plugin/repo.go similarity index 99% rename from datastore/rpc/repo.go rename to datastore/plugin/repo.go index 7351d7625..2bf1f84fc 100644 --- a/datastore/rpc/repo.go +++ b/datastore/plugin/repo.go @@ -1,4 +1,4 @@ -package rpc +package plugin import ( "time" diff --git a/datastore/rpc/task.go b/datastore/plugin/task.go similarity index 99% rename from datastore/rpc/task.go rename to datastore/plugin/task.go index 51e3d28c2..470043cf5 100644 --- a/datastore/rpc/task.go +++ b/datastore/plugin/task.go @@ -1,4 +1,4 @@ -package rpc +package plugin import ( "github.com/drone/drone/common" diff --git a/datastore/rpc/token.go b/datastore/plugin/token.go similarity index 97% rename from datastore/rpc/token.go rename to datastore/plugin/token.go index bef3dd946..5c16fc793 100644 --- a/datastore/rpc/token.go +++ b/datastore/plugin/token.go @@ -1,4 +1,4 @@ -package rpc +package plugin import ( "github.com/drone/drone/common" diff --git a/datastore/rpc/user.go b/datastore/plugin/user.go similarity index 99% rename from datastore/rpc/user.go rename to datastore/plugin/user.go index 7e11c6d7f..78b31089b 100644 --- a/datastore/rpc/user.go +++ b/datastore/plugin/user.go @@ -1,4 +1,4 @@ -package rpc +package plugin import ( "time" diff --git a/drone.go b/drone.go index c396b62f8..c119321c9 100644 --- a/drone.go +++ b/drone.go @@ -7,13 +7,13 @@ import ( "github.com/gin-gonic/gin" - "github.com/drone/drone/datastore/bolt" "github.com/drone/drone/remote/github" "github.com/drone/drone/server" "github.com/drone/drone/server/session" "github.com/drone/drone/settings" "github.com/elazarl/go-bindata-assetfs" + store "github.com/drone/drone/datastore/builtin" eventbus "github.com/drone/drone/eventbus/builtin" queue "github.com/drone/drone/queue/builtin" ) @@ -30,7 +30,7 @@ func main() { remote := github.New(settings.Service) session := session.New(settings.Session) - ds := bolt.Must(settings.Database.Path) + ds := store.Must(settings.Database.Path) defer ds.Close() r := gin.Default()