privatebin

package module
v0.0.0-...-7a6bfd5 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: ISC Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AData

type AData struct {
	Spec             Spec
	Formatter        string
	OpenDiscussion   bool
	BurnAfterReading bool
}

func (AData) MarshalJSON

func (adata AData) MarshalJSON() ([]byte, error)

func (*AData) UnmarshalJSON

func (adata *AData) UnmarshalJSON(data []byte) error

type Client

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

func NewClient

func NewClient(endpoint url.URL, options ...Option) *Client

func (*Client) CreatePaste

func (c *Client) CreatePaste(
	ctx context.Context,
	data []byte,
	opts CreatePasteOptions,
) (*CreatePasteResult, error)

func (*Client) ShowPaste

func (c *Client) ShowPaste(
	ctx context.Context,
	urlWithMasterKey url.URL,
	opts ShowPasteOptions,
) (*ShowPasteResult, error)

type Comment

type Comment struct {
	CommentID string
	PasteID   string
	ParentID  string
	Nickname  string
	Text      string
}

type CompressionAlgorithm

type CompressionAlgorithm uint8
const (
	CompressionAlgorithmUnknow CompressionAlgorithm = iota
	CompressionAlgorithmNone
	CompressionAlgorithmGZip
)

func (CompressionAlgorithm) MarshalJSON

func (ca CompressionAlgorithm) MarshalJSON() ([]byte, error)

func (CompressionAlgorithm) String

func (ca CompressionAlgorithm) String() string

func (*CompressionAlgorithm) UnmarshalJSON

func (ca *CompressionAlgorithm) UnmarshalJSON(data []byte) error

type CreatePasteOptions

type CreatePasteOptions struct {
	AttachmentName   string
	Formatter        string
	Expire           string
	OpenDiscussion   bool
	BurnAfterReading bool
	Compress         CompressionAlgorithm
	Password         []byte
}

type CreatePasteResult

type CreatePasteResult struct {
	PasteID     string
	PasteURL    url.URL
	DeleteToken string
}

type EncryptionAlgorithm

type EncryptionAlgorithm uint8
const (
	EncryptionAlgorithmUnknow EncryptionAlgorithm = iota
	EncryptionAlgorithmAES
)

func (EncryptionAlgorithm) MarshalJSON

func (ea EncryptionAlgorithm) MarshalJSON() ([]byte, error)

func (EncryptionAlgorithm) String

func (ea EncryptionAlgorithm) String() string

func (*EncryptionAlgorithm) UnmarshalJSON

func (ea *EncryptionAlgorithm) UnmarshalJSON(data []byte) error

type EncryptionMode

type EncryptionMode uint8
const (
	EncryptionModeUnknow EncryptionMode = iota
	EncryptionModeGCM
)

func (EncryptionMode) MarshalJSON

func (em EncryptionMode) MarshalJSON() ([]byte, error)

func (EncryptionMode) String

func (em EncryptionMode) String() string

func (*EncryptionMode) UnmarshalJSON

func (em *EncryptionMode) UnmarshalJSON(data []byte) error

type Option

type Option func(c *Client)

func WithBasicAuth

func WithBasicAuth(username, password string) Option

func WithCustomHeaderField

func WithCustomHeaderField(k, v string) Option

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) Option

func WithUserAgent

func WithUserAgent(userAgent string) Option

type Paste

type Paste struct {
	Data           []byte
	Attachment     []byte
	AttachmentName string
	MimeType       string
}

func (Paste) MarshalJSON

func (p Paste) MarshalJSON() ([]byte, error)

func (*Paste) UnmarshalJSON

func (p *Paste) UnmarshalJSON(data []byte) error

type ShowPasteOptions

type ShowPasteOptions struct {
	Password    []byte
	ConfirmBurn bool
}

type ShowPasteResult

type ShowPasteResult struct {
	PasteID      string
	CommentCount int
	Paste        Paste
	Comments     []Comment
}

type Spec

type Spec struct {
	IV          []byte
	Salt        []byte
	Iterations  int
	KeySize     int
	TagSize     int
	Algorithm   EncryptionAlgorithm
	Mode        EncryptionMode
	Compression CompressionAlgorithm
}

func (Spec) MarshalJSON

func (spec Spec) MarshalJSON() ([]byte, error)

func (*Spec) UnmarshalJSON

func (spec *Spec) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
cmd
privatebin command

Jump to

Keyboard shortcuts

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