Documentation ¶
Index ¶
- Constants
- Variables
- type Address
- type Application
- func (self *Application) Client() *proton.Client
- func (self *Application) LoginWithCredentials(ctx context.Context, credentials Credentials) error
- func (self *Application) LoginWithTokens(tokens *Tokens)
- func (self *Application) Manager() *proton.Manager
- func (self *Application) OnTokensExpired(handler TokensExpiredHandler)
- func (self *Application) OnTokensUpdated(handler TokensUpdatedHandler)
- func (self *Application) Tokens() *Tokens
- type Attributes
- type Credentials
- type EventLoop
- type FileReader
- type FileSystem
- func (self *FileSystem) CreateDir(ctx context.Context, parent *Link, name string) error
- func (self *FileSystem) Delete(ctx context.Context, link *Link) error
- func (self *FileSystem) Download(ctx context.Context, link *Link) (*FileReader, error)
- func (self *FileSystem) Move(ctx context.Context, link *Link, parent *Link, name string) error
- func (self *FileSystem) Upload(ctx context.Context, parent *Link, name string) (*FileWriter, error)
- type FileWriter
- type InitHandler
- type Link
- func (self *Link) BlockSizes() []int64
- func (self *Link) Children() mapset.Set[*Link]
- func (self *Link) ContentHash() string
- func (self *Link) CreationTime() time.Time
- func (self *Link) Hash() string
- func (self *Link) HashKey() []byte
- func (self *Link) ID() string
- func (self *Link) IsDir() bool
- func (self *Link) IsFile() bool
- func (self *Link) IsRoot() bool
- func (self *Link) Keyring() *crypto.KeyRing
- func (self *Link) MIMEType() string
- func (self *Link) ModificationTime() time.Time
- func (self *Link) Name() string
- func (self *Link) NameSignatureEmail() *Address
- func (self *Link) NodePassphrase() string
- func (self *Link) NodePassphraseSignature() string
- func (self *Link) Parent() *Link
- func (self *Link) Path() string
- func (self *Link) RevisionID() string
- func (self *Link) SessionKey() *crypto.SessionKey
- func (self *Link) Share() *Share
- func (self *Link) SignatureAddress() *Address
- func (self *Link) Size() int64
- type Links
- func (self *Links) Init(ctx context.Context) error
- func (self *Links) LinkFromID(linkID string) *Link
- func (self *Links) LinkFromPath(path string) *Link
- func (self *Links) OnEvent(event proton.LinkEvent) error
- func (self *Links) Root() *Link
- func (self *Links) Share() *Share
- func (self *Links) Volume() *Volume
- type Session
- type Share
- type Tokens
- type TokensExpiredHandler
- type TokensUpdatedHandler
- type User
- type Volume
Constants ¶
View Source
const ( BlockSize = 4 * 1024 * 1024 ISO8601Layout = "2006-01-02T15:04:05-0700" )
Variables ¶
View Source
var ( ErrUsernamePasswordMissing = errors.New("username/password missing") ErrTwoFactorTokenMissing = errors.New("2fa token missing") ErrMailboxPasswordMissing = errors.New("mailbox password missing") )
View Source
var ( ErrInvalidLink = errors.New("invalid link") ErrInvalidLinkType = errors.New("invalid link type, expected file") ErrAlreadyExists = errors.New("file or folder already exists") )
View Source
var ( ErrMainVolumeNotFound = errors.New("main volume not found") ErrLinkSignatureEmailNotFound = errors.New("signature email not found") ErrLinkNameSignatureEmailNotFound = errors.New("name signature email not found") )
View Source
var ( ErrOutOfRange = errors.New("out of range read") ErrBlockAddressNotFound = errors.New("block signature address not found") ErrBlockVerificationFailed = errors.New("block verification failed") ErrInvalidSeekOperation = errors.New("invalid seek operation") )
View Source
var (
ErrKeyringUnlockFailed = errors.New("failed to unlock keyring")
)
View Source
var (
ErrUnexpectedBlockUploadLinks = errors.New("unexpected number of block upload links")
)
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(version string) *Application
func (*Application) Client ¶
func (self *Application) Client() *proton.Client
func (*Application) LoginWithCredentials ¶
func (self *Application) LoginWithCredentials(ctx context.Context, credentials Credentials) error
func (*Application) LoginWithTokens ¶
func (self *Application) LoginWithTokens(tokens *Tokens)
func (*Application) Manager ¶
func (self *Application) Manager() *proton.Manager
func (*Application) OnTokensExpired ¶
func (self *Application) OnTokensExpired(handler TokensExpiredHandler)
func (*Application) OnTokensUpdated ¶
func (self *Application) OnTokensUpdated(handler TokensUpdatedHandler)
func (*Application) Tokens ¶
func (self *Application) Tokens() *Tokens
type Attributes ¶
type Credentials ¶
type EventLoop ¶
type EventLoop struct {
// contains filtered or unexported fields
}
func (*EventLoop) TriggerUpdate ¶
func (self *EventLoop) TriggerUpdate()
type FileReader ¶
type FileReader struct {
// contains filtered or unexported fields
}
func (*FileReader) Close ¶
func (self *FileReader) Close() error
func (*FileReader) Size ¶
func (self *FileReader) Size() int64
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
func (*FileSystem) Download ¶
func (self *FileSystem) Download(ctx context.Context, link *Link) (*FileReader, error)
func (*FileSystem) Upload ¶
func (self *FileSystem) Upload(ctx context.Context, parent *Link, name string) (*FileWriter, error)
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
func (*FileWriter) Close ¶
func (self *FileWriter) Close() error
func (*FileWriter) Hash ¶
func (self *FileWriter) Hash() string
func (*FileWriter) ModTime ¶
func (self *FileWriter) ModTime() time.Time
func (*FileWriter) SetModTime ¶
func (self *FileWriter) SetModTime(modTime time.Time)
func (*FileWriter) Size ¶
func (self *FileWriter) Size() int64
type InitHandler ¶
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func (*Link) BlockSizes ¶
func (*Link) ContentHash ¶
func (*Link) CreationTime ¶
func (*Link) ModificationTime ¶
func (*Link) NameSignatureEmail ¶
func (*Link) NodePassphrase ¶
func (*Link) NodePassphraseSignature ¶
func (*Link) RevisionID ¶
func (*Link) SessionKey ¶
func (self *Link) SessionKey() *crypto.SessionKey
func (*Link) SignatureAddress ¶
type Links ¶
type Links struct {
// contains filtered or unexported fields
}
func (*Links) LinkFromID ¶
func (*Links) LinkFromPath ¶
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func NewSession(application *Application) *Session
func (*Session) FileSystem ¶
func (self *Session) FileSystem() *FileSystem
type TokensExpiredHandler ¶
type TokensExpiredHandler func()
type TokensUpdatedHandler ¶
type TokensUpdatedHandler func(*Tokens)
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) AddressFromEmail ¶
func (*User) AddressFromID ¶
Click to show internal directories.
Click to hide internal directories.