Help us shape the future of Go! Take the 2026 Go Developer Survey

gostikkit

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2018 License: GPL-3.0 Imports: 16 Imported by: 0

README

Client for Stikked paste bin

This is a client library, and a command line client, for the Stikked paste bin (https://github.com/claudehohl/Stikked)

It's main distinguishing features are:

  • Support for client side encryption for pasting, and reading (compatible with the javascript implementation in the web interface)

Installation

go get github.com/tcolgate/gostikkit/cmd/gostikkit

Usage

Usage of gostikkit:
  -author string
    	Author of the post
  -encrypt
    	Encrypt the post
  -expire string
    	Expiration time, in minutes (or "never", or "burn")
  -file string
    	Post contents of this file
  -key string
    	API key, if needed
  -lang string
    	The language to render the post as
  -title string
    	Title of the post
  -url string
    	Post contents of this file

You can also use STIKKED_URL and STIKKED_KEY to pass in the base url and the api key for your stikked deployment.

Documentation

Index

Constants

View Source
const (
	ExpireNever        = time.Duration(-1)
	ExpireAfterReading = time.Duration(-2)
)

Variables

View Source
var DefaultClient = &Client{}

Functions

func Put

func Put(p Paste, r io.Reader, encrypt bool) (string, error)

Types

type Client

type Client struct {
	Base *url.URL
	Key  string

	Paste //The default post to use
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func (Client) Get

func (c Client) Get(id string) (*Paste, error)

func (Client) New

func (c Client) New() Paste

func (Client) Put

func (c Client) Put(p Paste, r io.Reader, crypt bool) (string, error)

type Paste

type Paste struct {
	Title   string
	Author  string
	Private bool
	Lang    string
	Expire  time.Duration
	ReplyTo string
	// contains filtered or unexported fields
}

func Get

func Get(id string) (*Paste, error)

func (*Paste) Close

func (p *Paste) Close() error

func (*Paste) Read

func (p *Paste) Read(bs []byte) (int, error)

Directories

Path Synopsis
cmd
gostikkit command
evpkdf module
lzjs module

Jump to

Keyboard shortcuts

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