megafs

package
v0.0.0-...-24ba59d Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(mfile *MegaPath) *basefs.File

File converts a mega drive Node structure to baseFS

func New

func New(core *core.Core) core.DriverFS

New Filesystem implementation based on basefs(webfs) Service

Types

type Config

type Config struct {
	// Fs service specific configuration here
	Credentials struct {
		Email    string
		Password string
	}
}

Config mega.yaml config file structure

type MegaPath

type MegaPath struct {
	Path string
	Node *mega.Node
}

MegaPath go-mega does not contain parent entries so we extract parents from Path

type Service

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

Service gdrive service information

func NewService

func NewService(coreConfig *core.Config, basefs *basefs.BaseFS) *Service

NewService creates and initializes a new Mega service

func (*Service) Changes

func (s *Service) Changes() ([]*basefs.Change, error)

Changes populate a list with changes to be handled on basefs Returns a list of changes

func (*Service) Create

func (s *Service) Create(parent *basefs.File, name string, isDir bool) (*basefs.File, error)

Create create an entry in google drive

func (*Service) Delete

func (s *Service) Delete(file *basefs.File) error

Delete file from service

func (*Service) DownloadTo

func (s *Service) DownloadTo(w io.Writer, file *basefs.File) error

DownloadTo from gdrive to a writer

func (*Service) ListAll

func (s *Service) ListAll() ([]*basefs.File, error)

ListAll lists all files recursively to cache locally

func (*Service) Move

func (s *Service) Move(file *basefs.File, newParent *basefs.File, name string) (*basefs.File, error)

Move a file in drive

func (*Service) StatFS

func (s *Service) StatFS(*fuseops.StatFSOp) error

func (*Service) Upload

func (s *Service) Upload(reader io.Reader, file *basefs.File) (*basefs.File, error)

Upload a file

Jump to

Keyboard shortcuts

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