protondrive

package
v3.60.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyPassOrSaltedKeyPassMustBeNotNil = errors.New("either keyPass or saltedKeyPass must be not nil")
	ErrFailedToUnlockUserKeys             = errors.New("failed to unlock user keys")
)

Functions

This section is empty.

Types

type Addition

type Addition struct {
	driver.RootPath

	Username  string `json:"username" required:"true" type:"string"`
	Password  string `json:"password" required:"true" type:"string"`
	TwoFACode string `json:"two_fa_code,omitempty" type:"string"`
}

type Config

type Config struct {
	Name        string `json:"name"`
	LocalSort   bool   `json:"local_sort"`
	OnlyLocal   bool   `json:"only_local"`
	OnlyProxy   bool   `json:"only_proxy"`
	NoCache     bool   `json:"no_cache"`
	NoUpload    bool   `json:"no_upload"`
	NeedMs      bool   `json:"need_ms"`
	DefaultRoot string `json:"default_root"`
}

type MoveRequest

type MoveRequest struct {
	ParentLinkID            string  `json:"ParentLinkID"`
	NodePassphrase          string  `json:"NodePassphrase"`
	NodePassphraseSignature *string `json:"NodePassphraseSignature"`
	Name                    string  `json:"Name"`
	NameSignatureEmail      string  `json:"NameSignatureEmail"`
	Hash                    string  `json:"Hash"`
	OriginalHash            string  `json:"OriginalHash"`
	ContentHash             *string `json:"ContentHash"` // Maybe null
}

type ProtonDrive

type ProtonDrive struct {
	model.Storage
	Addition

	MainShare *proton.Share
	RootLink  *proton.Link

	DefaultAddrKR *crypto.KeyRing
	MainShareKR   *crypto.KeyRing
	// contains filtered or unexported fields
}

func (*ProtonDrive) ArchiveDecompress

func (d *ProtonDrive) ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Obj, args model.ArchiveDecompressArgs) ([]model.Obj, error)

func (*ProtonDrive) Config

func (d *ProtonDrive) Config() driver.Config

func (*ProtonDrive) Copy

func (d *ProtonDrive) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

func (*ProtonDrive) DirectMove

func (d *ProtonDrive) DirectMove(ctx context.Context, srcObj model.Obj, dstDir model.Obj) (model.Obj, error)

func (*ProtonDrive) DirectRename

func (d *ProtonDrive) DirectRename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)

func (*ProtonDrive) Drop

func (d *ProtonDrive) Drop(ctx context.Context) error

func (*ProtonDrive) Extract

func (d *ProtonDrive) Extract(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) (*model.Link, error)

func (*ProtonDrive) GetAddition

func (d *ProtonDrive) GetAddition() driver.Additional

func (*ProtonDrive) GetArchiveMeta

func (d *ProtonDrive) GetArchiveMeta(ctx context.Context, obj model.Obj, args model.ArchiveArgs) (model.ArchiveMeta, error)

func (*ProtonDrive) Init

func (d *ProtonDrive) Init(ctx context.Context) error
func (d *ProtonDrive) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*ProtonDrive) List

func (d *ProtonDrive) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*ProtonDrive) ListArchive

func (d *ProtonDrive) ListArchive(ctx context.Context, obj model.Obj, args model.ArchiveInnerArgs) ([]model.Obj, error)

func (*ProtonDrive) MakeDir

func (d *ProtonDrive) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)

func (*ProtonDrive) Move

func (d *ProtonDrive) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

func (*ProtonDrive) Put

func (*ProtonDrive) Remove

func (d *ProtonDrive) Remove(ctx context.Context, obj model.Obj) error

func (*ProtonDrive) Rename

func (d *ProtonDrive) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)

type ProtonFile

type ProtonFile struct {
	*proton.Link
	Name     string
	IsFolder bool
}

func (*ProtonFile) CreateTime

func (p *ProtonFile) CreateTime() time.Time

func (*ProtonFile) GetName

func (p *ProtonFile) GetName() string

func (*ProtonFile) GetPath

func (p *ProtonFile) GetPath() string

func (*ProtonFile) GetSize

func (p *ProtonFile) GetSize() int64

func (*ProtonFile) IsDir

func (p *ProtonFile) IsDir() bool

func (*ProtonFile) ModTime

func (p *ProtonFile) ModTime() time.Time

type RenameRequest

type RenameRequest struct {
	Name               string `json:"Name"`               // PGP encrypted name
	NameSignatureEmail string `json:"NameSignatureEmail"` // User's signature email
	Hash               string `json:"Hash"`               // New name hash
	OriginalHash       string `json:"OriginalHash"`       // Current name hash
}

type RenameResponse

type RenameResponse struct {
	Code int `json:"Code"`
}

Jump to

Keyboard shortcuts

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