mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
taildrop: include the absolute path in WaitingFiles
updates ENG-2868 including the source path for waiting files allows capable clients to move temporary taildrop files to the users's chosen location directly, rather than using the /files GET and DELETE endpoints. Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
This commit is contained in:
parent
66e4d843c1
commit
21a6b02ed4
@ -30,9 +30,16 @@ type FileTarget struct {
|
||||
PeerAPIURL string
|
||||
}
|
||||
|
||||
// WaitingFiles represent taildrop files sent to the node, ready to be
|
||||
// copied to their permenant location by the client. The client may
|
||||
// opt to handle these these using either the /files GET and DELETE
|
||||
// endpoints or by moving the file if the client has read/write
|
||||
// access to the AbsolutePath. The client is responsible for removing
|
||||
// the file when they have finished processing it.
|
||||
type WaitingFile struct {
|
||||
Name string
|
||||
Size int64
|
||||
Name string
|
||||
Size int64
|
||||
AbsolutePath string
|
||||
}
|
||||
|
||||
// SetPushDeviceTokenRequest is the body POSTed to the LocalAPI endpoint /set-device-token.
|
||||
|
@ -80,8 +80,9 @@ func (m *Manager) WaitingFiles() (ret []apitype.WaitingFile, err error) {
|
||||
return true
|
||||
}
|
||||
ret = append(ret, apitype.WaitingFile{
|
||||
Name: filepath.Base(name),
|
||||
Size: fi.Size(),
|
||||
AbsolutePath: filepath.Join(m.opts.Dir, name),
|
||||
Name: filepath.Base(name),
|
||||
Size: fi.Size(),
|
||||
})
|
||||
}
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user