Documentation ¶
Overview ¶
Package datacapture contains tools for interacting with Viam datacapture files.
Index ¶
- Constants
- func BuildCaptureMetadata(compType resource.SubtypeName, compName string, method string, ...) *v1.DataCaptureMetadata
- func CreateDataCaptureFile(captureDir string, md *v1.DataCaptureMetadata) (*os.File, error)
- func EmptyReadingErr(fileName string) error
- func IsDataCaptureFile(f *os.File) bool
- func ReadDataCaptureMetadata(f *os.File) (*v1.DataCaptureMetadata, error)
- func ReadNextSensorData(f *os.File) (*v1.SensorData, error)
Constants ¶
const FileExt = ".capture"
FileExt defines the file extension for Viam data capture files.
Variables ¶
This section is empty.
Functions ¶
func BuildCaptureMetadata ¶
func BuildCaptureMetadata(compType resource.SubtypeName, compName string, method string, additionalParams map[string]string, ) *v1.DataCaptureMetadata
BuildCaptureMetadata builds a DataCaptureMetadata object.
func CreateDataCaptureFile ¶
CreateDataCaptureFile creates a timestamped file within the given capture directory.
func EmptyReadingErr ¶
EmptyReadingErr defines the error for when a SensorData contains no data.
func IsDataCaptureFile ¶
IsDataCaptureFile returns whether or not f is a data capture file.
func ReadDataCaptureMetadata ¶
func ReadDataCaptureMetadata(f *os.File) (*v1.DataCaptureMetadata, error)
ReadDataCaptureMetadata reads the SyncMetadata message from the beginning of the capture file.
func ReadNextSensorData ¶
func ReadNextSensorData(f *os.File) (*v1.SensorData, error)
ReadNextSensorData reads sensorData sequentially from a data capture file. It assumes the file offset is already pointing at the beginning of series of SensorData in the file. This is accomplished by first calling ReadDataCaptureMetadata.
Types ¶
This section is empty.