yasuc

command module
v0.0.0-...-c415e48 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2016 License: AGPL-3.0 Imports: 11 Imported by: 0

README

yasuc

yet another sprunge.us clone

(command line pastebin)

server usage

$ go get github.com/tomjakubowski/yasuc
$ yasuc -db /path/to/db -port PORT -addr BIND-ADDR

A Dockerfile is provided.

$ cd $GOPATH/github.com/tomjakubowski/yasuc
$ sudo docker build -t yasuc/yasuc:v0 .
$ sudo docker run -d -P --name yasuc-test yasuc/yasuc:v0

The docker run command will map a randomized port on the host to each of the container's exposed ports (just one right now). You can find the port using docker port:

$ sudo docker port yasuc-test
8080/tcp -> 0.0.0.0:32768
$ curl http://localhost:32768/
usage message goes here

client usage

<command> | curl -F 'sprunge=<-' http://my.yasuc.host/

examples

$ echo 'hello world' | curl -F 'sprunge=<-' http://my.yasuc.host/
http://my.yasuc.host/a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447
$ curl http://my.yasuc.host/a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447
hello world

Each paste is identified by the SHA-256 digest of its contents.

Copyright (c) Tom Jakubowski. License AGPLv3: Affero GPL Version 3. This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. For copying conditions and source, see the LICENSE.txt file.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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