Documentation ¶
Overview ¶
Package datacapture contains tools for interacting with Viam datacapture files.
Index ¶
- Constants
- func BuildCaptureMetadata(compType resource.SubtypeName, compName, compModel, method string, ...) (*v1.DataCaptureMetadata, error)
- func CreateDataCaptureFile(captureDir string, md *v1.DataCaptureMetadata) (*os.File, error)
- func GetFileExt(dataType v1.DataType, methodName string, parameters map[string]string) string
- 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, compModel, method string, additionalParams map[string]string, tags []string, ) (*v1.DataCaptureMetadata, error)
BuildCaptureMetadata builds a DataCaptureMetadata object and returns error if additionalParams fails to convert to anypb map.
func CreateDataCaptureFile ¶
CreateDataCaptureFile creates a timestamped file within the given capture directory.
func GetFileExt ¶ added in v0.0.9
GetFileExt gets the file extension for a capture file.
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 DataCaptureMetadata 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.