stateservice

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package stateservice implements a centralized IoT device state storage service. See the controller.StateService proto.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	cpb.UnimplementedStateServiceServer
	// contains filtered or unexported fields
}

Service implements controller.StateService.

func New

func New(ctx context.Context, projectParams *cloudconfig.Params) (*Service, error)

New returns a new StateService implementation.

func (*Service) GetDeviceState

func (s *Service) GetDeviceState(ctx context.Context, req *cpb.GetDeviceStateRequest) (*cpb.DeviceState, error)

func (*Service) SetDeviceState

type Store

type Store interface {
	StoreDeviceState(ctx context.Context, user *acls.Identity, s *controller.DeviceState) error
	GetDeviceState(ctx context.Context, user *acls.Identity, name string) (*controller.DeviceState, error)
	ListDevices(ctx context.Context, user *acls.Identity) ([]string, error)
}

Jump to

Keyboard shortcuts

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