cloudiot

package
v0.0.0-...-51806ab Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudIoTRepository

type CloudIoTRepository struct {
	// contains filtered or unexported fields
}

CloudIoTRepository provides acccess to the Cloud IoT-backed public key registry.

func NewCloudIoTRepository

func NewCloudIoTRepository(ctx context.Context, r Registry, client *http.Client) (*CloudIoTRepository, error)

NewCloudIoTRepository creates a new Cloud IoT repostory client.

`client` parameter is optional. If you supply your own client, you have to make sure you set the correct authentication headers yourself. If no client is given, authentication information is looked up from the environment.

func (*CloudIoTRepository) ListAllDeviceIDs

func (c *CloudIoTRepository) ListAllDeviceIDs(ctx context.Context) ([]string, error)

ListAllDeviceIDs returns a slice of all device identifiers found in the registry.

Blocked credentials are included.

func (*CloudIoTRepository) LookupKey

func (c *CloudIoTRepository) LookupKey(ctx context.Context, deviceID string) (string, error)

LookupKey retrieves the public key of a device from the IoT registry.

An empty string return indicates that no key exists for the given identifier or that the device is blocked. If multiple keys are found only the first is returned.

func (*CloudIoTRepository) PublishKey

func (c *CloudIoTRepository) PublishKey(ctx context.Context, deviceID, publicKey string) error

PublishKey updates the public key of a device.

Creates a new device if the given device identifier does not exist. Blocked devices can be updated.

type Registry

type Registry struct {
	Project  string
	Region   string
	Registry string
}

Registry defines the Cloud IoT device registry to use as key repository.

Jump to

Keyboard shortcuts

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