Categorygithub.com/jceaser/stacker
modulepackage
0.0.0-20240405014014-649a294900e8
Repository: https://github.com/jceaser/stacker.git
Documentation: pkg.go.dev

# README

Stacker

A tool for saving things to a stack to share between tmux sessions

What is this and why

I have a need to "copy and paste" things between tmux panes all the time. A standard clipboard could be used, but I don't always have a clipboard (old twm machine for instance) and some times I want the value to persist, or even stranger, I want one copy and multiple pastes. I tried fifo files, but the copy app is held till the paste app runs and it is not one to many but one to one. Also, fifo will not persist through a reboot.

This solution is to create a simple clipboard cache in a file.

Usage

Create something:

>echo thing | stacker

Peek at something:

>stacker -peek
thing

Read something, consuming it:

>stacker
thing

Show everything in a tab delimitated list:

>stacker -ls
0 thing 1
1 thing 2

Update something, replacing:

>echo wrong-thing | stacker ; echo Thing | stacker -update

Delete something

>stacker -delete

Web Usage

Use the -http flag to start the server. This mode will use -host and -port and defaults to localhost on port 54321.

MethodPathDescription
GET/listList stack items
GET/peekReturn top item on stack
POST/rotateRotate Stack
PUT/pushPush value onto stack
DELETE/popPop the stack
HEAD/*Info on holdings

gRPC Usage

To communicate using gRPC over the internet, use the following flags:

FlagOptionNotes
-hostnameURL name of the server
-portnumberPort number
-rpcdStart the server
-rpclistList stack items
pushPush standard in onto the stack
popPop from the stack
peekReturn top item on stack, leave it there
rotateRotate the stack

Development

To test the application, use:

>go test ./tests/...

To build this application, take care to name the output because "stacker" is a directory:

>go build -o bin/stacker

Copyright 2024 by [email protected], all rights reserved.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

export XDG_CONFIG_HOME=~/.config/test ; go run stacker.go */.
create app data from the command line flags */.
Primary action for the app, if a stream exists, then push it to the stack, if on stream then pop from the stack.

# Structs

Holds all application configuration and state, can be passed to lower functions if needed */.