posix-oneshot

command
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

POSIX one-shot CLI

posix-oneshot is a command line tool to add entries to a log stored on the local filesystem.

Example usage

The commands below create a new log and add entries to it, and then show a few approaches to inspect the contents of the log.

# Set the keys via environment variables
export LOG_PRIVATE_KEY="PRIVATE+KEY+example.com/log/testdata+33d7b496+AeymY/SZAX0jZcJ8enZ5FY1Dz+wTML2yWSkK+9DSF3eg"
export LOG_PUBLIC_KEY="example.com/log/testdata+33d7b496+AeHTu4Q3hEIMHNqc6fASMsq3rKNx280NI+oO5xCFkkSx"

# Initialize a new log
export LOG_DIR=/tmp/mylog
go run ./cmd/examples/posix-oneshot --storage_dir=${LOG_DIR} --initialise

# Create files containing new leaves to add
mkdir /tmp/stuff
echo "foo" > /tmp/stuff/foo
echo "bar" > /tmp/stuff/bar
echo "baz" > /tmp/stuff/baz

# Integrate all of these leaves into the tree
go run ./cmd/examples/posix-oneshot --storage_dir=${LOG_DIR} --entries="/tmp/stuff/*"

# Check that the checkpoint is of the correct size and the leaves are present
cat ${LOG_DIR}/checkpoint
cat ${LOG_DIR}/tile/entries/000.p/*

# Optionally, inspect the log using the woodpecker tool to see the contents
go run github.com/mhutchinson/woodpecker@main --custom_log_type=tiles --custom_log_url=file:///${LOG_DIR}/ --custom_log_origin=example.com/log/testdata --custom_log_vkey=${LOG_PUBLIC_KEY}

# More entries can be added to the log using the following:
go run ./cmd/examples/posix-oneshot --storage_dir=${LOG_DIR} --entries="/tmp/stuff/*"

Using the log

A POSIX log can be used directly via file paths, but a more common approach to using such a log is to use static file hosting to do this. A couple of approaches are:

  • NGINX
  • GitHub - the files can be accessed via the raw URLs

Documentation

Overview

posix-oneshot is a command line tool for adding entries to a local tlog-tiles log stored on a posix filesystem. The command takes a list of new entries to add to the log, and exits when they are successfully integrated. See the README in this package for more detailed usage instructions.

Jump to

Keyboard shortcuts

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