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. For more information, see the data management service docs.
Package datamanager contains a gRPC based datamanager service server
Index ¶
- Constants
- Variables
- func CreateShouldSyncReading(toSync bool) map[string]interface{}
- func Named(name string) resource.Name
- func NamesFromRobot(r robot.Robot) []string
- func NewRPCServiceServer(coll resource.APIResourceCollection[Service]) interface{}
- type AssociatedConfig
- type DataCaptureConfig
- type Service
Constants ¶
const SubtypeName = "data_manager"
SubtypeName is the name of the type of service.
Variables ¶
var API = resource.APINamespaceRDK.WithServiceType(SubtypeName)
API is a variable that identifies the data manager service resource API.
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
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 NamesFromRobot ¶ added in v0.27.0
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 (*AssociatedConfig) Link ¶ added in v0.24.0
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. For more information, see the data management service docs.
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.
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. |
capture
Package capture implements datacapture for the builtin datamanger
|
Package capture implements datacapture for the builtin datamanger |
sync
Package sync implements datasync for the builtin datamanger
|
Package sync implements datasync for the builtin datamanger |
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 |