ffstools

module
v0.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2024 License: Apache-2.0

README

Command-line tools for FFS

See also https://github.com/creachadair/ffs.

  • The blobd tool defines an RPC service that implements the FFS blob store interface over various underlying key-value storage implementations.

    # To install:
    go install github.com/creachadair/ffstools/blobd@latest
    
  • The ffs tool also communicates with the blobd service and provides commands to manipulate the contents of the store as FFS specific messages.

    # To install:
    go install github.com/creachadair/ffstools/ffs@latest
    

    The ffs blob subcommand replaced the separate blob tool in #30.

  • The file2json tool decodes wire-format node messages and translates them to JSON for easier reading by humans.

    # To install:
    go install github.com/creachadair/ffstools/file2json@latest
    

Installation and Usage

Install blobd and ffs as noted above, then:

# Start up a storage server (blobd) using local files as storage.
export FFS_STORE=/tmp/test.db.sock
blobd -store file:test.db -listen "$FFS_STORE" &
while [[ ! -e "$FFS_STORE" ]] ; do sleep 1 ; done

# Create a root pointer to anchor some data.
ffs root create example --desc 'Example root pointer'

# Create some files to put into storage.
mkdir -p files/sub
echo "This is my file." > files/sub/f1.txt
echo "Many others are like it" > files/sub/f2.txt
echo "But this one is mine." > files/f3.txt

# Copy the files directory into the store.
ffs put -into example/test1 files

# List the contents we just wrote...
ffs file list -long example/test1
ffs file list -long example/test1/sub

# Move some files around...
echo "That was your file." > files/sub/f1.txt
mv files/sub/f2.txt files/f4.txt
rm files/f3.txt

# Add another copy of the structure.
ffs put -into example/test2 files

# List the revised contents...
ffs file list -long example/test1
ffs file list -long example/test2
ffs file list -long example/test2/sub

# List the stuff reachable from the root.
ffs file list -long -key example

# GC unreachable data in the store.
ffs gc

# Stop the blobd.
kill %1 && wait

Directories

Path Synopsis
Program blobd exports a blob.Store via the Chirp V0 protocol.
Program blobd exports a blob.Store via the Chirp V0 protocol.
ffs
config
Package config defines the configuration settings shared by the subcommands of the ffs command-line tool.
Package config defines the configuration settings shared by the subcommands of the ffs command-line tool.
internal/cmdblob
Package cmdblob provides basic support for reading and writing implementations of the blob.Store interface.
Package cmdblob provides basic support for reading and writing implementations of the blob.Store interface.
internal/cmdexport
Package cmdexport implements the "ffs export" subcommand.
Package cmdexport implements the "ffs export" subcommand.
internal/cmdfile
Package cmdfile implements the "ffs file" subcommand.
Package cmdfile implements the "ffs file" subcommand.
internal/cmdgc
Package cmdgc implements the "ffs gc" subcommand.
Package cmdgc implements the "ffs gc" subcommand.
internal/cmdmount
Package cmdmount implements the "ffs mount" subcommand.
Package cmdmount implements the "ffs mount" subcommand.
internal/cmdput
Package cmdput implements the "ffs put" subcommand.
Package cmdput implements the "ffs put" subcommand.
internal/cmdroot
Package cmdroot implements the "ffs root" subcommand.
Package cmdroot implements the "ffs root" subcommand.
internal/cmdstatus
Package cmdstatus implements the "ffs status" subcommand.
Package cmdstatus implements the "ffs status" subcommand.
internal/cmdstorage
Package cmdstorage implements the "ffs storage" subcommand.
Package cmdstorage implements the "ffs storage" subcommand.
internal/cmdstorage/registry
Package registry carries the registry of available storage implementations.
Package registry carries the registry of available storage implementations.
internal/cmdsync
Package cmdsync implements the "ffs sync" subcommand.
Package cmdsync implements the "ffs sync" subcommand.
lib
pbar
Package pbar implements a simple percentage-based terminal progress indicator.
Package pbar implements a simple percentage-based terminal progress indicator.
putlib
Package putlib implements common plumbing for copying file trees from a local filesystem into FFS representation.
Package putlib implements common plumbing for copying file trees from a local filesystem into FFS representation.
store
Package store provides an interface to open blob.Store instances named by string addresses or URLs.
Package store provides an interface to open blob.Store instances named by string addresses or URLs.
zstdc
Package zstdc implements the encoded.Codec interface using zstd compression.
Package zstdc implements the encoded.Codec interface using zstd compression.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL