From 4463b4a1df5d1ab205537f484d2c30517be41d8c Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 19 May 2021 19:17:46 -0700 Subject: delete reference to namespaces We don't need namespaces, a better abstraction is to use different buckets, as this provides a better abstraction to manage quotas and permissions. --- users/fcuny/exp/buckit/README.org | 21 ++++++++------------- users/fcuny/exp/buckit/add.go | 4 ++-- users/fcuny/exp/buckit/delete.go | 8 ++++---- users/fcuny/exp/buckit/fetch.go | 4 ++-- users/fcuny/exp/buckit/info.go | 4 ++-- users/fcuny/exp/buckit/list.go | 7 +++---- 6 files changed, 21 insertions(+), 27 deletions(-) (limited to 'users/fcuny') diff --git a/users/fcuny/exp/buckit/README.org b/users/fcuny/exp/buckit/README.org index d6ab4c5..bad0dae 100644 --- a/users/fcuny/exp/buckit/README.org +++ b/users/fcuny/exp/buckit/README.org @@ -3,14 +3,13 @@ ~buckit~ is a tool to add files to a GCS bucket. * Store -=buckit= is a CLI to upload files to a GCS bucket. A file belongs to a *namespace*. A namespace can have multiple *files*. Each files can have multiple *versions*. +=buckit= is a CLI to upload files to a GCS bucket. A *package* belongs to a *bucket*. A bucket can have multiple *packages*. Each package can have multiple *versions*. -When a version of a file is added to a namespace, a record is created in the index. +When a version of a file is added to a bucket, a record is created in the index. A record is composed of the following information: - the version of the file - the name of the file -- the name of the namespace - the checksum of the version - the path in the GCS bucket - the user who uploaded the version @@ -19,7 +18,7 @@ A record is composed of the following information: GCS' ACLs are used to change the visibility of the object in the bucket. -The index is a single JSON file stored at the root of the bucket. The keys in the index are the namespace. Inside a namespace, keys are the name of the files. Files contain a list of versions, in order (the most recent version is the last entry in the list). +The index is a single JSON file stored at the root of the bucket. The keys in the index are the packages. Packages contain a list of versions, in order (the most recent version is the last entry in the list). A lock is used for both read and write of the file. ** Life cycle of files @@ -34,30 +33,26 @@ When a file is marked for deletion, it can not be fetched anymore. The state can * CLI ** add #+begin_src sh -buckit add +buckit add #+end_src ** list #+begin_src sh buckit list #+end_src - -#+begin_src sh -buckit list -#+end_src ** fetch #+begin_src sh -buckit fetch +buckit fetch #+end_src ** info #+begin_src sh -buckit info +buckit info #+end_src ** delete #+begin_src sh -buckit delete +buckit delete #+end_src ** undelete #+begin_src sh -bucket undelete +bucket undelete #+end_src diff --git a/users/fcuny/exp/buckit/add.go b/users/fcuny/exp/buckit/add.go index 32f5870..c29476e 100644 --- a/users/fcuny/exp/buckit/add.go +++ b/users/fcuny/exp/buckit/add.go @@ -6,9 +6,9 @@ import ( var addCmd = &cli.Command{ Name: "add", - Usage: "Add a file to a namespace", + Usage: "Add a package", Action: addAction, - ArgsUsage: " ", + ArgsUsage: " ", } func addAction(ctx *cli.Context) error { diff --git a/users/fcuny/exp/buckit/delete.go b/users/fcuny/exp/buckit/delete.go index 6e504a9..7bd2ab2 100644 --- a/users/fcuny/exp/buckit/delete.go +++ b/users/fcuny/exp/buckit/delete.go @@ -6,16 +6,16 @@ import ( var deleteCmd = &cli.Command{ Name: "delete", - Usage: "Delete a version of a file within a namespace", + Usage: "Delete a version of a package", Action: deleteAction, - ArgsUsage: " ", + ArgsUsage: " ", } var undeleteCmd = &cli.Command{ Name: "undelete", - Usage: "Un-delete a version of a file within a namespace", + Usage: "Un-delete a version of a package", Action: undeleteAction, - ArgsUsage: " ", + ArgsUsage: " ", } func deleteAction(ctx *cli.Context) error { diff --git a/users/fcuny/exp/buckit/fetch.go b/users/fcuny/exp/buckit/fetch.go index 9ac31cc..e4204ae 100644 --- a/users/fcuny/exp/buckit/fetch.go +++ b/users/fcuny/exp/buckit/fetch.go @@ -6,9 +6,9 @@ import ( var fetchCmd = &cli.Command{ Name: "fetch", - Usage: "Fetch a version of a file within a namespace", + Usage: "Fetch a version of a package", Action: fetchAction, - ArgsUsage: " ", + ArgsUsage: " ", } func fetchAction(ctx *cli.Context) error { diff --git a/users/fcuny/exp/buckit/info.go b/users/fcuny/exp/buckit/info.go index a75add4..f8ad448 100644 --- a/users/fcuny/exp/buckit/info.go +++ b/users/fcuny/exp/buckit/info.go @@ -6,9 +6,9 @@ import ( var infoCmd = &cli.Command{ Name: "info", - Usage: "Get information about a version of a file in a namespace", + Usage: "Get information about a version of a package", Action: infoAction, - ArgsUsage: " ", + ArgsUsage: " ", } func infoAction(ctx *cli.Context) error { diff --git a/users/fcuny/exp/buckit/list.go b/users/fcuny/exp/buckit/list.go index 5d81c34..1c080ab 100644 --- a/users/fcuny/exp/buckit/list.go +++ b/users/fcuny/exp/buckit/list.go @@ -5,10 +5,9 @@ import ( ) var listCmd = &cli.Command{ - Name: "list", - Usage: "List namespaces or files within a namespace", - Action: listAction, - ArgsUsage: "[namespace]", + Name: "list", + Usage: "List packages", + Action: listAction, } func listAction(ctx *cli.Context) error { -- cgit 1.4.1