Documentation
¶
Overview ¶
Package taildrop registers the taildrop (file sending) feature.
Package taildrop contains the implementation of the Taildrop functionality including sending and retrieving files. This package does not validate permissions, the caller should be responsible for ensuring correct authorization.
For related documentation see: http://go/taildrop-how-does-it-work
Index ¶
- Constants
- Variables
- type Extension
- func (e *Extension) AwaitWaitingFiles(ctx context.Context) ([]apitype.WaitingFile, error)
- func (e *Extension) Clock() tstime.Clock
- func (e *Extension) DeleteFile(name string) error
- func (e *Extension) FileTargets() ([]*apitype.FileTarget, error)
- func (e *Extension) Init(h ipnext.Host) error
- func (e *Extension) Name() string
- func (e *Extension) OpenFile(name string) (rc io.ReadCloser, size int64, err error)
- func (e *Extension) SetDirectFileRoot(root string)
- func (e *Extension) SetFileOps(fileOps FileOps)
- func (e *Extension) Shutdown() error
- func (e *Extension) WaitingFiles() ([]apitype.WaitingFile, error)
- type FileOps
- type PutMode
Constants ¶
const SafDirectoryPrefix = "content://"
safDirectoryPrefix is used to determine if the directory is managed via SAF.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Extension ¶
type Extension struct { // FileOps abstracts platform-specific file operations needed for file transfers. // This is currently being used for Android to use the Storage Access Framework. FileOps FileOps // contains filtered or unexported fields }
Extension implements Taildrop.
func (*Extension) AwaitWaitingFiles ¶
AwaitWaitingFiles is like WaitingFiles but blocks while ctx is not done, waiting for any files to be available.
On return, exactly one of the results will be non-empty or non-nil, respectively.
func (*Extension) DeleteFile ¶
func (*Extension) FileTargets ¶
func (e *Extension) FileTargets() ([]*apitype.FileTarget, error)
FileTargets lists nodes that the current node can send files to.
func (*Extension) SetDirectFileRoot ¶
SetDirectFileRoot sets the directory where received files are written.
This must be called before Tailscale is started.
func (*Extension) SetFileOps ¶
SetFileOps sets the platform specific file operations. This is used to call Android's Storage Access Framework APIs.
func (*Extension) WaitingFiles ¶
func (e *Extension) WaitingFiles() ([]apitype.WaitingFile, error)
type FileOps ¶
type FileOps interface { OpenFileWriter(filename string) (io.WriteCloser, string, error) // RenamePartialFile finalizes a partial file. // It returns the new SAF URI as a string and an error. RenamePartialFile(partialUri, targetDirUri, targetName string) (string, error) }
FileOps defines platform-specific file operations.