files

package
v0.1.0-develop.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_UPLOADED  = iota
	STATUS_UPLOADING = iota
	STATUS_NOT_FOUND = iota
)

Variables

View Source
var (
	ErrAlreadyExists          = errors.New("Upload already exists")
	ErrFailedFetchObject      = errors.New("Failed fetching object")
	ErrFailedFetchObjectProof = errors.New("Failed fetching object proof")
	ErrFailedFetchTusObject   = errors.New("Failed fetching tus object")
	ErrFailedHashFile         = errors.New("Failed to hash file")
	ErrFailedQueryTusUpload   = errors.New("Failed to query tus uploads")
	ErrFailedQueryUpload      = errors.New("Failed to query uploads")
	ErrFailedQueryPins        = errors.New("Failed to query pins")
	ErrFailedSaveUpload       = errors.New("Failed saving upload to db")
	ErrFailedSavePin          = errors.New("Failed saving pin to db")
	ErrFailedUpload           = errors.New("Failed uploading object")
	ErrFailedUploadProof      = errors.New("Failed uploading object proof")
	ErrFileExistsOutOfSync    = errors.New("File already exists in network, but missing in database")
	ErrFileHashMismatch       = errors.New("File hash does not match provided file hash")
	ErrInvalidFile            = errors.New("Invalid file")
)

Functions

func Download

func Download(hash string) (io.Reader, error)

func DownloadProof

func DownloadProof(hash string) (io.Reader, error)

func Init

func Init()

func Pin

func Pin(hash string, accountID uint) error

func Status

func Status(hash string) int

func Upload

func Upload(r io.ReadSeeker, size int64, hash []byte, accountID uint) (model.Upload, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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