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 ¶
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.