Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksanford committed Nov 13, 2024
1 parent a119c1c commit 2dbcd5e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
6 changes: 3 additions & 3 deletions components/camera/camera.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ func init() {
data.RegisterCollector(data.MethodMetadata{
API: API,
MethodName: nextPointCloud.String(),
}, NewNextPointCloudCollector)
}, newNextPointCloudCollector)
data.RegisterCollector(data.MethodMetadata{
API: API,
MethodName: readImage.String(),
}, NewReadImageCollector)
}, newReadImageCollector)
data.RegisterCollector(data.MethodMetadata{
API: API,
MethodName: getImages.String(),
}, NewGetImagesCollector)
}, newGetImagesCollector)
}

// SubtypeName is a constant that identifies the camera resource subtype string.
Expand Down
9 changes: 3 additions & 6 deletions components/camera/collectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ func (m method) String() string {
return "Unknown"
}

// NewNextPointCloudCollector creates a collector for camera.NextPointCloud.
func NewNextPointCloudCollector(resource interface{}, params data.CollectorParams) (data.Collector, error) {
func newNextPointCloudCollector(resource interface{}, params data.CollectorParams) (data.Collector, error) {
camera, err := assertCamera(resource)
if err != nil {
return nil, err
Expand Down Expand Up @@ -73,8 +72,7 @@ func NewNextPointCloudCollector(resource interface{}, params data.CollectorParam
return data.NewCollector(cFunc, params)
}

// NewReadImageCollector creates a collector for camera.GetImage.
func NewReadImageCollector(resource interface{}, params data.CollectorParams) (data.Collector, error) {
func newReadImageCollector(resource interface{}, params data.CollectorParams) (data.Collector, error) {
camera, err := assertCamera(resource)
if err != nil {
return nil, err
Expand Down Expand Up @@ -126,8 +124,7 @@ func NewReadImageCollector(resource interface{}, params data.CollectorParams) (d
return data.NewCollector(cFunc, params)
}

// NewGetImagesCollector creates a collector for camera.GetImages.
func NewGetImagesCollector(resource interface{}, params data.CollectorParams) (data.Collector, error) {
func newGetImagesCollector(resource interface{}, params data.CollectorParams) (data.Collector, error) {
camera, err := assertCamera(resource)
if err != nil {
return nil, err
Expand Down
10 changes: 10 additions & 0 deletions components/camera/export_collectors_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package camera

// export_collectors_test.go adds functionality to the package that we only want to use and expose during testing.

// Exported variables for testing collectors, see unexported collectors for implementation details.
var (
NewNextPointCloudCollector = newNextPointCloudCollector
NewReadImageCollector = newReadImageCollector
NewGetImagesCollector = newGetImagesCollector
)

0 comments on commit 2dbcd5e

Please sign in to comment.