#+TITLE: buckit ~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*. When a version of a file is added to a namespace, 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 - the timestamp of when the uploaded happened - the state of the file 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). A lock is used for both read and write of the file. ** Life cycle of files *** Deletion By default, when a file is uploaded, we mark the state has *present*. Versions can be deleted. This is a soft-delete: - the state is changed to *tombstone* - the expiration date for blob is set 30 days in the future When a file is marked for deletion, it can not be fetched anymore. The state can be changed to be mark as present. In which case the expiration date is removed on the blob. * CLI ** add #+begin_src sh 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 #+end_src ** info #+begin_src sh buckit info #+end_src ** delete #+begin_src sh buckit delete #+end_src ** undelete #+begin_src sh bucket undelete #+end_src