onionbuffer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allocate

func Allocate(length int) ([]byte, error)

func Decrypt

func Decrypt(data []byte, passphrase string) ([]byte, error)

func Encrypt

func Encrypt(data []byte, passphrase string) ([]byte, error)

func Unallocate

func Unallocate(bytes []byte) error

func WriteFilesToZip

func WriteFilesToZip(w *zip.Writer, files chan *multipart.FileHeader, wg *sync.WaitGroup) error

Types

type OnionBuffer

type OnionBuffer struct {
	sync.RWMutex
	Name          string
	Bytes         []byte
	Checksum      string
	Encrypted     bool
	Downloads     int64
	DownloadLimit int64
	Expire        bool
	ExpiresAt     time.Time
}

OnionBuffer struct

func (*OnionBuffer) Destroy

func (b *OnionBuffer) Destroy() error

Destroy is mostly used to destroy temporary OnionBuffer objects after they have been copied to the store or to remove an individual OnionBuffer from the store.

func (*OnionBuffer) GetChecksum

func (b *OnionBuffer) GetChecksum() (string, error)

func (*OnionBuffer) IsExpired

func (b *OnionBuffer) IsExpired() bool

IsExpired is used to check if an OnionBuffer is expired or not.

func (*OnionBuffer) Mlock

func (b *OnionBuffer) Mlock() error

func (*OnionBuffer) Munlock

func (b *OnionBuffer) Munlock() error

func (*OnionBuffer) SetExpiration

func (b *OnionBuffer) SetExpiration(expiration string) error

SetExpiration is used to set the expiration duration of the OnionBuffer.

func (*OnionBuffer) ValidateChecksum

func (b *OnionBuffer) ValidateChecksum() (bool, error)

Jump to

Keyboard shortcuts

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