tarball

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendTarFile

func AppendTarFile(tarFile string, file *File) error

func FileHasher

func FileHasher() hash.Hash

func ReadTarBuffer

func ReadTarBuffer(tarFile string) (*bytes.Buffer, error)

func Tar

func Tar(sourceDir string, tarFile string) error

func Untar

func Untar(tarFile string, targetDir string) error

Types

type File

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

File represents Bee file

func NewBufferFile

func NewBufferFile(name string, buffer *bytes.Buffer) *File

NewBufferFile returns new file with specified buffer

func NewBytesFile

func NewBytesFile(name string, data []byte) *File

func (*File) Address

func (f *File) Address() swarm.Address

Address returns file's address

func (*File) CalculateHash

func (f *File) CalculateHash() error

CalculateHash calculates hash from dataReader. It replaces dataReader with another that will contain the data.

func (*File) DataReader

func (f *File) DataReader() io.Reader

DataReader returns file's data reader

func (*File) Hash

func (f *File) Hash() []byte

Hash returns file's hash

func (*File) Name

func (f *File) Name() string

Name returns file's name

func (*File) SetAddress

func (f *File) SetAddress(a swarm.Address)

func (*File) SetHash

func (f *File) SetHash(h []byte)

func (*File) Size

func (f *File) Size() int64

Size returns file size

Jump to

Keyboard shortcuts

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