datacapture

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package datacapture contains tools for interacting with Viam datacapture files.

Index

Constants

View Source
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

func CreateDataCaptureFile(captureDir string, md *v1.DataCaptureMetadata) (*os.File, error)

CreateDataCaptureFile creates a timestamped file within the given capture directory.

func GetFileExt added in v0.0.9

func GetFileExt(dataType v1.DataType, methodName string, parameters map[string]string) string

GetFileExt gets the file extension for a capture file.

func IsDataCaptureFile

func IsDataCaptureFile(f *os.File) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL