privatebin

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: ISC Imports: 19 Imported by: 1

README

Introduction

This repository contains a CLI for privatebin server.

Abstract

I am a big privatebin user, and I never found a clean CLI to deal with it. It why I decided to build this project to simplify my day-to-day workflow.

Install

You can install the command line interface with:

FreeBSD

pkg install privatebin-cli

Arch Linux

privatebin-cli on AUR

Privatebin-cli is available on the AUR:

You can install it using your AUR helper of choice.

Example:

$ yay -Sy privatebin-cli

From source

git clone https://github.com/gearnode/privatebin.git
cd privatebin
make
make install

Usage

You can create paste from file with:

cat resume.txt | privatebin -bin demo

Build

You can build the command line interface with:

make build

Documentation

The handbook contains informations about various aspects of the command line interface.

You can also use the standard Go documentation tool to read code documentation, for example:

go doc -all github.com/gearnode/privatebin

Contact

If you find a bug or have any question, feel free to open a Github issue or to contact me by email.

Please note that I do not currently review or accept any contribution.

Licence

Released under the ISC license.

Copyright (c) 2020-2022 Bryan Frimin bryan@frimin.fr.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Documentation

Index

Constants

View Source
const (
	PrivateBinAPIVersion = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	URL      url.URL
	Username string
	Password string
}

func NewClient

func NewClient(uri *url.URL, username, password string) *Client

func (*Client) CreatePaste

func (c *Client) CreatePaste(
	message *PasteMessage,
	expire, formatter string,
	openDiscussion, burnAfterReading, gzip bool,
	password string,
) (*CreatePasteResponse, error)

type CreatePasteRequest

type CreatePasteRequest struct {
	V     int                    `json:"v"`
	AData []interface{}          `json:"adata"`
	Meta  CreatePasteRequestMeta `json:"meta"`
	CT    string                 `json:"ct"`
}

type CreatePasteRequestMeta

type CreatePasteRequestMeta struct {
	Expire string `json:"expire"`
}

type CreatePasteResponse

type CreatePasteResponse struct {
	ID          string `json:"id"`
	Status      int    `json:"status"`
	Message     string `json:"message"`
	URL         string `json:"url"`
	DeleteToken string `json:"deletetoken"`
}

type PasteContent

type PasteContent struct {
	Paste          string `json:"paste"`
	Attachment     string `json:"attachment,omitempty"`
	AttachmentName string `json:"attachment_name,omitempty"`
}

type PasteData

type PasteData struct {
	*PasteSpec
	Data             []byte
	Formatter        string
	OpenDiscussion   bool
	BurnAfterReading bool
}

type PasteMessage

type PasteMessage struct {
	Attachment bool
	Filename   string
	Data       []byte
}

type PasteSpec

type PasteSpec struct {
	IV          string
	Salt        string
	Iterations  int
	KeySize     int
	TagSize     int
	Algorithm   string
	Mode        string
	Compression string
}

func (*PasteSpec) SpecArray

func (ps *PasteSpec) SpecArray() []interface{}

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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