provision

package
v0.0.0-...-0fa7426 Latest Latest
Warning

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

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

Documentation

Overview

Copyright © 2020 Randy Ridgley randy.ridgley@gmail.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidResponse = errors.New("invalid response from AWS IoT")

ErrInvalidResponse is returned if failed to parse response from AWS IoT.

Functions

This section is empty.

Types

type Channels

type Channels struct {
	RegisterKeysChan  chan bool
	RegisterThingChan chan bool
	ProvisionChan     chan bool
}

type Parameters

type Parameters struct {
	SerialNumber   string `json:"serialNumber"`
	DeviceLocation string `json:"deviceLocation"`
}

type Provision

type Provision interface {
	Provision(ctx context.Context)
	Disconnect(ctx context.Context)
}

Provision is an interface of Thing Provisioning.

type Provisioner

type Provisioner struct {
	Channels                   Channels
	KeysAndCertificateResponse struct {
		CertificateId             string `json:"certificateId"`
		CertificatePem            string `json:"certificatePem"`
		PrivateKey                string `json:"privateKey"`
		CertificateOwnershipToken string `json:"certificateOwnershipToken"`
	}
	RegisterThingResponse struct {
		ThingName           string `json:"thingName"`
		DeviceConfiguration string `json:"deviceConfiguration"`
	}
	Connection connect.Connection
	// contains filtered or unexported fields
}

func New

func New(tx context.Context, thing device.Thing, bootstrapKeypair connect.KeyPair) (*Provisioner, error)

New - Function to create a new Provisioner

func (*Provisioner) Disconnect

func (p *Provisioner) Disconnect(ctx context.Context)

func (*Provisioner) Provision

func (p *Provisioner) Provision(ctx context.Context)

func (*Provisioner) PublishThingRequest

func (p *Provisioner) PublishThingRequest()

func (*Provisioner) RegisterThing

func (p *Provisioner) RegisterThing(ctx context.Context)

type RegisterThingRequest

type RegisterThingRequest struct {
	CertificateOwnershipToken string     `json:"certificateOwnershipToken"`
	Parameters                Parameters `json:"parameters"`
}

func NewRegisterThingRequest

func NewRegisterThingRequest(p *Provisioner) *RegisterThingRequest

Jump to

Keyboard shortcuts

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