ipn/ipnlocal: provide IPN bus updates as files arrive

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-04-08 14:54:25 -07:00
committed by Brad Fitzpatrick
parent 2f398106e2
commit 6d01d3bece
3 changed files with 120 additions and 12 deletions

View File

@ -67,7 +67,8 @@ type Notify struct {
BackendLogID *string // public logtail id used by backend
PingResult *ipnstate.PingResult
FilesWaiting *empty.Message `json:",omitempty"`
FilesWaiting *empty.Message `json:",omitempty"`
IncomingFiles []PartialFile `json:",omitempty"`
// LocalTCPPort, if non-nil, informs the UI frontend which
// (non-zero) localhost TCP port it's listening on.
@ -78,6 +79,14 @@ type Notify struct {
// type is mirrored in xcode/Shared/IPN.swift
}
// PartialFile represents an in-progress file transfer.
type PartialFile struct {
Name string // e.g. "foo.jpg"
Started time.Time // time transfer started
DeclaredSize int64 // or -1 if unknown
Received int64 // bytes copied thus far
}
// StateKey is an opaque identifier for a set of LocalBackend state
// (preferences, private keys, etc.).
//