fulaMobile

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STORE_PATH = "storePath"
	//I will cheet until i can add threadsafe datastore
	MY_BOX = "/mybox/cheat"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DirEntry added in v0.4.7

type DirEntry struct {
	Name string
	Type EntryType
	Size int
	Cid  string
}

type EntryType added in v0.4.7

type EntryType int
const (
	File      EntryType = 1
	Directory EntryType = 2
)

type Fula

type Fula struct {
	Node rhost.RoutedHost
	// contains filtered or unexported fields
}

func NewFula

func NewFula(repoPath string) (*Fula, error)

func (*Fula) AddBox

func (f *Fula) AddBox(boxAddr string) error

func (*Fula) Delete added in v0.4.7

func (f *Fula) Delete(userDID string, path string) error

Deletes an entry in a path on a user's drive Calls a RequestDelete on the file protocol

func (*Fula) GetBox added in v0.4.7

func (f *Fula) GetBox() (peer.ID, error)

func (*Fula) Ls added in v0.4.7

func (f *Fula) Ls(userDID string, path string) ([]DirEntry, error)

Lists entries in a path on a user's drive Calls a RequestLs on the file protocol

func (*Fula) MkDir added in v0.4.7

func (f *Fula) MkDir(userDID string, path string) error

Makes a new directory on user's drive Calls a RequsetMkDir on the file protocol

func (*Fula) NewStream

func (f *Fula) NewStream() (network.Stream, error)

func (*Fula) Read added in v0.4.7

func (f *Fula) Read(userDID string, filePath string, destPath string) error

Reads a file from a user's drive Calls a ReadRequest on the file protocol It writes the recieved file into a specified path on local storage

func (*Fula) Write added in v0.4.7

func (f *Fula) Write(userDID string, srcPath string, destPath string) error

Writes a file on a user's drive Calls a WriteRequest on the file protocol It writes an existing file on the local storage in a user's drive in a given location

type IFula

type IFula interface {
	AddBox(string) error
	Read(string, string, string) error
	Write(string, string, string) error
	MkDir(string, string) error
	Ls(string, string) ([]DirEntry, error)
	Delete(string, string) error
}

Jump to

Keyboard shortcuts

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