datamanager

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: AGPL-3.0 Imports: 13 Imported by: 4

Documentation

Overview

Package datamanager contains a gRPC based datamanager service server

Package datamanager contains a service type that can be used to capture data from a robot's components.

Package datamanager contains a gRPC based datamanager service server

Index

Constants

View Source
const SubtypeName = "data_manager"

SubtypeName is the name of the type of service.

Variables

View Source
var API = resource.APINamespaceRDK.WithServiceType(SubtypeName)

API is a variable that identifies the data manager service resource API.

View Source
var ShouldSyncKey = "should_sync"

ShouldSyncKey is a special key we use within a modular sensor to pass a boolean that indicates to the datamanager whether or not we want to sync.

Functions

func CreateShouldSyncReading added in v0.13.0

func CreateShouldSyncReading(toSync bool) map[string]interface{}

CreateShouldSyncReading is a helper for creating the expected reading for a modular sensor that passes a bool to the datamanager to indicate whether or not we want to sync.

func Named

func Named(name string) resource.Name

Named is a helper for getting the named datamanager's typed resource name.

func NamesFromRobot added in v0.27.0

func NamesFromRobot(r robot.Robot) []string

NamesFromRobot is a helper for getting all data manager services from the given Robot.

func NewRPCServiceServer added in v0.2.36

func NewRPCServiceServer(coll resource.APIResourceCollection[Service]) interface{}

NewRPCServiceServer constructs a datamanager gRPC service server. It is intentionally untyped to prevent use outside of tests.

Types

type AssociatedConfig added in v0.24.0

type AssociatedConfig struct {
	CaptureMethods []DataCaptureConfig `json:"capture_methods"`
}

AssociatedConfig specify a list of methods to capture on resources and implements the resource.AssociatedConfig interface.

func (*AssociatedConfig) Equals added in v0.24.0

func (ac *AssociatedConfig) Equals(other resource.AssociatedConfig) bool

Equals describes if an DataCaptureConfigs is equal to a given AssociatedConfig.

func (ac *AssociatedConfig) Link(conf *resource.Config)

Link associates an AssociatedConfig to a specific resource model (e.g. builtin data capture).

func (*AssociatedConfig) UpdateResourceNames added in v0.24.0

func (ac *AssociatedConfig) UpdateResourceNames(updater func(old resource.Name) resource.Name)

UpdateResourceNames allows the caller to modify the resource names of data capture in place.

type DataCaptureConfig added in v0.2.36

type DataCaptureConfig struct {
	Name               resource.Name     `json:"name"`
	Method             string            `json:"method"`
	CaptureFrequencyHz float32           `json:"capture_frequency_hz"`
	CaptureQueueSize   int               `json:"capture_queue_size"`
	CaptureBufferSize  int               `json:"capture_buffer_size"`
	AdditionalParams   map[string]string `json:"additional_params"`
	Disabled           bool              `json:"disabled"`
	Tags               []string          `json:"tags,omitempty"`
	CaptureDirectory   string            `json:"capture_directory"`
}

DataCaptureConfig is used to initialize a collector for a component or remote.

func (*DataCaptureConfig) Equals added in v0.2.36

func (c *DataCaptureConfig) Equals(other *DataCaptureConfig) bool

Equals checks if one capture config is equal to another.

type Service

type Service interface {
	resource.Resource
	// Sync will sync data stored on the machine to the cloud.
	Sync(ctx context.Context, extra map[string]interface{}) error
}

Service defines what a Data Manager Service should expose to the users.

Sync example:

// Sync data stored on the machine to the cloud.
err := data.Sync(context.Background(), nil)

func FromDependencies added in v0.12.0

func FromDependencies(deps resource.Dependencies, name string) (Service, error)

FromDependencies is a helper for getting the named data manager service from a collection of dependencies.

func FromRobot added in v0.0.8

func FromRobot(r robot.Robot, name string) (Service, error)

FromRobot is a helper for getting the named data manager service from the given Robot.

func NewClientFromConn

func NewClientFromConn(
	ctx context.Context,
	conn rpc.ClientConn,
	remoteName string,
	name resource.Name,
	logger logging.Logger,
) (Service, error)

NewClientFromConn constructs a new Client from connection passed in.

Directories

Path Synopsis
Package builtin contains a service type that can be used to capture data from a robot's components.
Package builtin contains a service type that can be used to capture data from a robot's components.
Package datacapture contains tools for interacting with Viam datacapture files.
Package datacapture contains tools for interacting with Viam datacapture files.
Package datasync contains interfaces for syncing data from robots to the app.viam.com cloud.
Package datasync contains interfaces for syncing data from robots to the app.viam.com cloud.
Package internal implements a data manager service definition with additional exported functions for the purpose of testing
Package internal implements a data manager service definition with additional exported functions for the purpose of testing
Package register registers all relevant datamanager models and also API specific functions
Package register registers all relevant datamanager models and also API specific functions

Jump to

Keyboard shortcuts

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