privatebin

package
v0.0.0-...-9e182d0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultURL = "https://bin.0xfc.de"
)

Variables

This section is empty.

Functions

func ValidExpire

func ValidExpire(expire string) bool

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(url string) *Client

func (*Client) Send

func (c *Client) Send(p *Paste) (*RespSuccess, error)

type InnerPaste

type InnerPaste struct {
	Nonce           string
	KDFSalt         string
	KDFIterations   int
	KDFKeySize      int
	ADataSize       int
	CipherAlgo      string
	CipherMode      string
	CompressionType string
}

type Paste

type Paste struct {
	// contains filtered or unexported fields
}

func NewPaste

func NewPaste(content []byte, password string, formatter string, attachmentName string, attachment string,
	compress bool, burn int, opendiscussion int, expire string) *Paste

func (Paste) GetPassphrase

func (p Paste) GetPassphrase() []byte

type PasteData

type PasteData struct {
	InnerPaste     InnerPaste
	Formatter      string
	OpenDiscussion int
	Burn           int
}

type PasteMeta

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

type PasteReq

type PasteReq struct {
	V     int         `json:"v"`
	AData interface{} `json:"adata"`
	CT    string      `json:"ct"`
	Meta  PasteMeta   `json:"meta"`
}

type RawPasteData

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

type RespError

type RespError struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

type RespStatus

type RespStatus struct {
	Status int `json:"status"`
}

type RespSuccess

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

Jump to

Keyboard shortcuts

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