file

package
v0.0.0-...-6333696 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoOfParallelWorkers = runtime.NumCPU() * 4
)

Functions

This section is empty.

Types

type Blocks

type Blocks struct {
	Name           string `json:"name"`
	Reference      string `json:"reference"`
	Size           string `json:"size"`
	CompressedSize string `json:"compressed_size"`
}

type File

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

func NewFile

func NewFile(podName string, client blockstore.Client, fd *feed.API, acc *account.AccountInfo, logger logging.Logger) *File

func (*File) AddFileToPath

func (f *File) AddFileToPath(filePath, metaHexRef string) error

func (*File) AddToFileMap

func (f *File) AddToFileMap(filePath string, meta *m.FileMetaData)

func (*File) Cat

func (f *File) Cat(fileName string) error

func (*File) CopyToFile

func (f *File) CopyToFile(podFile string, localDir string) error

func (*File) Download

func (f *File) Download(podFile string) (io.ReadCloser, string, string, error)

func (*File) FileStat

func (f *File) FileStat(podName, fileName, account string) (*FileStats, error)

func (*File) GetContentType

func (f *File) GetContentType(bufferReader *bufio.Reader) string

func (*File) GetFileReference

func (f *File) GetFileReference(podFile string) ([]byte, string, error)

func (*File) GetFromFileMap

func (f *File) GetFromFileMap(filePath string) *m.FileMetaData

func (*File) IsFileAlreadyPResent

func (f *File) IsFileAlreadyPResent(fileWithPath string) bool

func (*File) ListFiles

func (f *File) ListFiles(directory string) []string

func (*File) LoadFileMeta

func (f *File) LoadFileMeta(podName string, addr []byte) (int, error)

func (*File) RemoveFromFileMap

func (f *File) RemoveFromFileMap(filePath string)

func (*File) Upload

func (f *File) Upload(fd io.Reader, fileName string, fileSize int64, blockSize uint32, filePath, compression string) ([]byte, error)

type FileBlock

type FileBlock struct {
	Name           string
	Size           uint32
	CompressedSize uint32
	Address        []byte
}

type FileINode

type FileINode struct {
	FileBlocks []*FileBlock
}

type FileStats

type FileStats struct {
	Account          string `json:"account"`
	PodName          string `json:"pod_name"`
	FilePath         string `json:"file_path"`
	FileName         string `json:"file_name"`
	FileSize         string `json:"file_size"`
	BlockSize        string `json:"block_size"`
	Compression      string `json:"compression"`
	ContentType      string `json:"content_type"`
	CreationTime     string `json:"creation_time"`
	ModificationTime string `json:"modification_time"`
	AccessTime       string `json:"access_time"`
	Blocks           []Blocks
}

type Reader

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

func NewReader

func NewReader(fileInode FileINode, client blockstore.Client, fileSize uint64, blockSize uint32, compression string) *Reader

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Read

func (r *Reader) Read(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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