client

package
v0.0.0-...-905d515 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: AGPL-3.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Refreshing deviceState = iota
	Ready
	Error
)

Variables

View Source
var ErrDeviceNotFound error = errors.New("not found")

Functions

This section is empty.

Types

type Device

type Device interface {
	ID() string
	Environment() string
	IsActive() bool
	Latitude() float64
	Longitude() float64
	SensorType() string
	Source() string
	Tenant() string
	Types() []string
}

you need to modify the generated ../test/device_mock.go import "github.com/diwise/iot-device-mgmt/pkg/client" change "var _ Device = &DeviceMock{}" to "var _ client.Device = &DeviceMock{}"

type DeviceManagementClient

type DeviceManagementClient interface {
	FindDeviceFromDevEUI(ctx context.Context, devEUI string) (Device, error)
	FindDeviceFromInternalID(ctx context.Context, deviceID string) (Device, error)
	Close(ctx context.Context)
	CreateDevice(ctx context.Context, device types.Device) error
}

func New

func New(ctx context.Context, devMgmtUrl, oauthTokenURL, oauthClientID, oauthClientSecret string) (DeviceManagementClient, error)

Jump to

Keyboard shortcuts

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