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 GetFileExt(dataType v1.DataType, methodName string, parameters map[string]string) string
- func IsDataCaptureFile(f *os.File) bool
- type File
- func (f *File) Close() error
- func (f *File) Delete() error
- func (f *File) GetPath() string
- func (f *File) ReadMetadata() *v1.DataCaptureMetadata
- func (f *File) ReadNext() (*v1.SensorData, error)
- func (f *File) Size() int64
- func (f *File) Sync() error
- func (f *File) WriteNext(data *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 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.
Types ¶
type File ¶ added in v0.1.6
type File struct {
// contains filtered or unexported fields
}
File is the data structure containing data captured by collectors. It is backed by a file on disk containing length delimited protobuf messages, where the first message is the CaptureMetadata for the file, and ensuing messages contain the captured data.
func NewFile ¶ added in v0.1.6
func NewFile(captureDir string, md *v1.DataCaptureMetadata) (*File, error)
NewFile creates a new File with the specified md in the specified directory.
func ReadFile ¶ added in v0.1.6
ReadFile creates a File struct from a passed os.File previously constructed using NewFile.
func (*File) ReadMetadata ¶ added in v0.1.6
func (f *File) ReadMetadata() *v1.DataCaptureMetadata
ReadMetadata reads and returns the metadata in f.
func (*File) ReadNext ¶ added in v0.1.6
func (f *File) ReadNext() (*v1.SensorData, error)
ReadNext returns the next SensorData reading.