pod

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 (
	ErrInvalidPodName       = errors.New("invalid pod name")
	ErrTooLongPodName       = errors.New("pod name too long")
	ErrPodAlreadyExists     = errors.New("pod already exists")
	ErrMaxPodsReached       = errors.New("max number of pods reached")
	ErrPodNotOpened         = errors.New("pod not opened")
	ErrInvalidDirectory     = errors.New("invalid directory name")
	ErrTooLongDirectoryName = errors.New("directory name too long")
)

Functions

func CleanDirName

func CleanDirName(dirName string) ([]string, error)

func CleanPodName

func CleanPodName(podName string) (string, error)

Types

type Info

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

func (*Info) GetCurrentDirInode

func (i *Info) GetCurrentDirInode() *di.DirInode

func (*Info) GetCurrentDirNameOnly

func (i *Info) GetCurrentDirNameOnly() string

func (*Info) GetCurrentDirPathAndName

func (i *Info) GetCurrentDirPathAndName() string

func (*Info) GetCurrentDirPathOnly

func (i *Info) GetCurrentDirPathOnly() string

func (*Info) GetCurrentPodInode

func (i *Info) GetCurrentPodInode() *di.DirInode

func (*Info) GetCurrentPodNameOnly

func (i *Info) GetCurrentPodNameOnly() string

func (*Info) GetCurrentPodPathAndName

func (i *Info) GetCurrentPodPathAndName() string

func (*Info) GetCurrentPodPathOnly

func (i *Info) GetCurrentPodPathOnly() string

func (*Info) IsCurrentDirRoot

func (p *Info) IsCurrentDirRoot() bool

func (*Info) SetCurrentDirInode

func (i *Info) SetCurrentDirInode(podInode *di.DirInode)

func (*Info) SetCurrentPodInode

func (i *Info) SetCurrentPodInode(podInode *di.DirInode)

func (*Info) SyncPod

func (pi *Info) SyncPod(podName string, client blockstore.Client, logger logging.Logger) error

type Pod

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

func NewPod

func NewPod(client blockstore.Client, feed *feed.API, account *account.Account, logger logging.Logger) *Pod

func (*Pod) Cat

func (p *Pod) Cat(podName string, fileName string) error

func (*Pod) ChangeDir

func (p *Pod) ChangeDir(podName string, dirName string) (*Info, error)

func (*Pod) ClosePod

func (p *Pod) ClosePod(podName string) error

func (*Pod) CopyToLocal

func (p *Pod) CopyToLocal(podName string, podFile string, localDir string) error

func (*Pod) CreatePod

func (p *Pod) CreatePod(podName, passPhrase string) (*Info, error)

func (*Pod) DeletePod

func (p *Pod) DeletePod(podName string) error

func (*Pod) DirectoryStat

func (p *Pod) DirectoryStat(podName, podFileOrDir string, printNames bool) (*dir.DirStats, error)

func (*Pod) DownloadFile

func (p *Pod) DownloadFile(podName, podFile string) (io.ReadCloser, string, string, error)

func (*Pod) FileStat

func (p *Pod) FileStat(podName, podFileOrDir string) (*file.FileStats, error)

func (*Pod) GetAccountInfo

func (p *Pod) GetAccountInfo(podName string) (*account.AccountInfo, error)

func (*Pod) GetClient

func (p *Pod) GetClient() blockstore.Client

func (*Pod) GetInodeFromName

func (p *Pod) GetInodeFromName(nameToGetMeta string, curDirInode *d.DirInode, directory *d.Directory, info *Info) (*d.DirInode, error)

func (*Pod) GetMetaReferenceOfFile

func (p *Pod) GetMetaReferenceOfFile(podName, filePath string) ([]byte, string, error)

func (*Pod) GetName

func (p *Pod) GetName(inode *d.DirInode) string

func (*Pod) GetPath

func (p *Pod) GetPath(inode *d.DirInode) string

func (*Pod) GetPodInfoFromPodMap

func (p *Pod) GetPodInfoFromPodMap(name string) (*Info, error)

func (*Pod) ListEntiesInDir

func (p *Pod) ListEntiesInDir(podName, dirName string) ([]dir.DirOrFileEntry, error)

func (*Pod) ListPods

func (p *Pod) ListPods() ([]string, error)

func (*Pod) MakeDir

func (p *Pod) MakeDir(podName string, dirName string) error

func (*Pod) OpenPod

func (p *Pod) OpenPod(podName, passPhrase string) (*Info, error)

func (*Pod) PodStat

func (p *Pod) PodStat(podName string) (*PodStat, error)

func (*Pod) ReceiveFileAndStore

func (p *Pod) ReceiveFileAndStore(podName, podDir, fileName, metaHexRef string) error

func (*Pod) RemoveDir

func (p *Pod) RemoveDir(podName string, dirName string) error

func (*Pod) RemoveFile

func (p *Pod) RemoveFile(podName string, podFile string) error

func (*Pod) SyncPod

func (p *Pod) SyncPod(podName string) error

func (*Pod) UpdateTillThePod

func (p *Pod) UpdateTillThePod(podName string, directory *d.Directory, topic []byte, path string, isAddHash bool) error

Assumption is that the d.currentDirInode is the newly updated one

func (*Pod) UploadFile

func (p *Pod) UploadFile(podName, fileName string, fileSize int64, fd io.Reader, podDir, blockSize, compression string) (string, error)

type PodStat

type PodStat struct {
	Version          string
	PodName          string
	PodPath          string
	CreationTime     string
	AccessTime       string
	ModificationTime string
}

Jump to

Keyboard shortcuts

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