mega

package
v0.0.0-...-f81bbf2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

README

Mega

This is the storage backend for the mega cloud storage.

Usage

To store data on mega you need a mega account and its e-mail address and password. You can use the knoxite URL scheme in order to interact with this backend. Currently the e-mail address needs to be url encoded.

knoxite repo init -r mega://example%40knoxite.com:password@/desired/path

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MegaStorage

type MegaStorage struct {
	knoxite.StorageFilesystem
	// contains filtered or unexported fields
}

MegaStorage stores data on a remote Mega.

func (*MegaStorage) AvailableSpace

func (backend *MegaStorage) AvailableSpace() (uint64, error)

AvailableSpace returns the free space on this backend.

func (*MegaStorage) Close

func (backend *MegaStorage) Close() error

Close the backend.

func (*MegaStorage) CreatePath

func (backend *MegaStorage) CreatePath(path string) error

CreatePath creates a dir including all its parent dirs, when required.

func (*MegaStorage) DeleteFile

func (backend *MegaStorage) DeleteFile(path string) error

DeleteFile deletes a file from mega.

func (*MegaStorage) Description

func (backend *MegaStorage) Description() string

Description returns a user-friendly description for this backend.

func (*MegaStorage) Location

func (backend *MegaStorage) Location() string

Location returns the type and location of the repository.

func (*MegaStorage) NewBackend

func (*MegaStorage) NewBackend(u url.URL) (knoxite.Backend, error)

NewBackend returns a MegaStorage backend.

func (*MegaStorage) Protocols

func (backend *MegaStorage) Protocols() []string

Protocols returns the Protocol Schemes supported by this backend.

func (*MegaStorage) ReadFile

func (backend *MegaStorage) ReadFile(path string) ([]byte, error)

ReadFile reads a file from mega.

func (*MegaStorage) Stat

func (backend *MegaStorage) Stat(path string) (uint64, error)

Stat returns the size of a file.

func (*MegaStorage) WriteFile

func (backend *MegaStorage) WriteFile(path string, data []byte) (size uint64, err error)

WriteFile write files on mega.

Jump to

Keyboard shortcuts

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