Documentation ¶
Overview ¶
Package datasync contains interfaces for syncing data from robots to the app.viam.com cloud.
Index ¶
Constants ¶
const FailedDir = "failed"
FailedDir is a subdirectory of the capture directory that holds any files that could not be synced.
const MaxParallelSyncRoutines = 1000
MaxParallelSyncRoutines is the maximum number of sync goroutines that can be running at once.
Variables ¶
var ( // InitialWaitTimeMillis defines the time to wait on the first retried upload attempt. InitialWaitTimeMillis = atomic.NewInt32(1000) // RetryExponentialFactor defines the factor by which the retry wait time increases. RetryExponentialFactor = atomic.NewInt32(2) // OfflineWaitTimeSeconds defines the amount of time to wait to retry if the machine is offline. OfflineWaitTimeSeconds = atomic.NewInt32(60) )
var MaxUnaryFileSize = int64(units.MB)
MaxUnaryFileSize is the max number of bytes to send using the unary DataCaptureUpload, as opposed to the StreamingDataCaptureUpload.
var UploadChunkSize = 64 * 1024
UploadChunkSize defines the size of the data included in each message of a FileUpload stream.
Functions ¶
func SetFileLastModifiedMillis ¶ added in v0.17.0
func SetFileLastModifiedMillis(lastModifiedMillis int)
SetFileLastModifiedMillis allows configuring the time to wait in milliseconds to check if a file has been modified for arbitrary file uploads.
Types ¶
type Manager ¶
type Manager interface { SyncFile(path string) SetArbitraryFileTags(tags []string) Close() MarkInProgress(path string) bool UnmarkInProgress(path string) }
Manager is responsible for enqueuing files in captureDir and uploading them to the cloud.
func NewManager ¶ added in v0.0.6
func NewManager(identity string, client v1.DataSyncServiceClient, logger logging.Logger, captureDir string, maxSyncThreads int, ) (Manager, error)
NewManager returns a new syncer.
func NewNoopManager ¶ added in v0.2.25
func NewNoopManager() Manager
NewNoopManager returns a noop sync manager that does nothing.