iot

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	CertificateId  string
	CertificateArn string
	CertificatePem string
	KeyPair        map[string]string
	Status         string // ACTIVE, INACTIVE, REVOKED
	CreationDate   time.Time
	Policies       []string // attached policy names
}

type IoTService

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

IoTService is the cloudmock implementation of the AWS IoT Core API.

func New

func New(accountID, region string) *IoTService

New returns a new IoTService for the given AWS account ID and region.

func (*IoTService) Actions

func (s *IoTService) Actions() []service.Action

Actions returns the list of IoT API actions supported by this service.

func (*IoTService) HandleRequest

func (s *IoTService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming IoT request to the appropriate handler.

func (*IoTService) HealthCheck

func (s *IoTService) HealthCheck() error

HealthCheck always returns nil.

func (*IoTService) Name

func (s *IoTService) Name() string

Name returns the AWS service name used for routing.

type Job

type Job struct {
	JobID          string
	JobArn         string
	Description    string
	TargetArns     []string
	Status         string // IN_PROGRESS, COMPLETED, CANCELLED, DELETION_IN_PROGRESS
	DocumentSource string
	Document       string
	CreationDate   time.Time
	LastUpdated    time.Time
	CompletedAt    *time.Time
}

type JobExecution

type JobExecution struct {
	JobID     string
	ThingArn  string
	Status    string
	QueuedAt  time.Time
	StartedAt *time.Time
}

type Policy

type Policy struct {
	PolicyName     string
	PolicyArn      string
	PolicyDocument string
	VersionId      string
	CreationDate   time.Time
	Targets        []string // attached targets (certificate ARNs, etc.)
}

type Store

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

func NewStore

func NewStore(accountID, region string) *Store

func (*Store) AddThingToThingGroup

func (s *Store) AddThingToThingGroup(thingName, groupName string) *service.AWSError

func (*Store) AttachPolicy

func (s *Store) AttachPolicy(policyName, targetArn string) *service.AWSError

func (*Store) AttachThingPrincipal

func (s *Store) AttachThingPrincipal(thingName, principal string) *service.AWSError

func (*Store) CancelJob

func (s *Store) CancelJob(jobID string) *service.AWSError

func (*Store) CreateJob

func (s *Store) CreateJob(jobID, description, documentSource, document string, targetArns []string) (*Job, *service.AWSError)

func (*Store) CreateKeysAndCertificate

func (s *Store) CreateKeysAndCertificate(setAsActive bool) (*Certificate, *service.AWSError)

func (*Store) CreatePolicy

func (s *Store) CreatePolicy(name, document string) (*Policy, *service.AWSError)

func (*Store) CreateThing

func (s *Store) CreateThing(name, thingTypeName string, attributes map[string]string) (*Thing, *service.AWSError)

func (*Store) CreateThingGroup

func (s *Store) CreateThingGroup(name, parentGroupName string, properties map[string]any) (*ThingGroup, *service.AWSError)

func (*Store) CreateThingType

func (s *Store) CreateThingType(name string, properties map[string]any) (*ThingType, *service.AWSError)

func (*Store) CreateTopicRule

func (s *Store) CreateTopicRule(name, sql, description string, actions []map[string]any, ruleDisabled bool) (*TopicRule, *service.AWSError)

func (*Store) DeleteCertificate

func (s *Store) DeleteCertificate(certId string) *service.AWSError

func (*Store) DeletePolicy

func (s *Store) DeletePolicy(name string) *service.AWSError

func (*Store) DeleteThing

func (s *Store) DeleteThing(name string) *service.AWSError

func (*Store) DeleteThingGroup

func (s *Store) DeleteThingGroup(name string) *service.AWSError

func (*Store) DeleteThingType

func (s *Store) DeleteThingType(name string) *service.AWSError

func (*Store) DeleteTopicRule

func (s *Store) DeleteTopicRule(name string) *service.AWSError

func (*Store) DescribeCertificate

func (s *Store) DescribeCertificate(certId string) (*Certificate, *service.AWSError)

func (*Store) DescribeJob

func (s *Store) DescribeJob(jobID string) (*Job, *service.AWSError)

func (*Store) DescribeThing

func (s *Store) DescribeThing(name string) (*Thing, *service.AWSError)

func (*Store) DescribeThingGroup

func (s *Store) DescribeThingGroup(name string) (*ThingGroup, *service.AWSError)

func (*Store) DescribeThingType

func (s *Store) DescribeThingType(name string) (*ThingType, *service.AWSError)

func (*Store) DetachPolicy

func (s *Store) DetachPolicy(policyName, targetArn string) *service.AWSError

func (*Store) DetachThingPrincipal

func (s *Store) DetachThingPrincipal(thingName, principal string) *service.AWSError

func (*Store) GetPolicy

func (s *Store) GetPolicy(name string) (*Policy, *service.AWSError)

func (*Store) GetTopicRule

func (s *Store) GetTopicRule(name string) (*TopicRule, *service.AWSError)

func (*Store) ListAttachedPolicies

func (s *Store) ListAttachedPolicies(targetArn string) []*Policy

func (*Store) ListCertificates

func (s *Store) ListCertificates() []*Certificate

func (*Store) ListJobs

func (s *Store) ListJobs() []*Job

func (*Store) ListPolicies

func (s *Store) ListPolicies() []*Policy

func (*Store) ListTagsForResource

func (s *Store) ListTagsForResource(arn string) (map[string]string, *service.AWSError)

func (*Store) ListTargetsForPolicy

func (s *Store) ListTargetsForPolicy(policyName string) ([]string, *service.AWSError)

ListTargetsForPolicy returns the targets (ARNs) a policy is attached to.

func (*Store) ListThingGroups

func (s *Store) ListThingGroups() []*ThingGroup

func (*Store) ListThingPrincipals

func (s *Store) ListThingPrincipals(thingName string) ([]string, *service.AWSError)

ListThingPrincipals returns the principals (certificates) attached to a thing.

func (*Store) ListThingTypes

func (s *Store) ListThingTypes() []*ThingType

func (*Store) ListThings

func (s *Store) ListThings() []*Thing

func (*Store) ListTopicRules

func (s *Store) ListTopicRules() []*TopicRule

func (*Store) RemoveThingFromThingGroup

func (s *Store) RemoveThingFromThingGroup(thingName, groupName string) *service.AWSError

func (*Store) TagResource

func (s *Store) TagResource(arn string, tags map[string]string) *service.AWSError

func (*Store) UntagResource

func (s *Store) UntagResource(arn string, tagKeys []string) *service.AWSError

func (*Store) UpdateCertificate

func (s *Store) UpdateCertificate(certId, newStatus string) *service.AWSError

UpdateCertificate changes the status of a certificate.

func (*Store) UpdateThing

func (s *Store) UpdateThing(name, thingTypeName string, attributes map[string]string, removeThingType bool) *service.AWSError

type Thing

type Thing struct {
	ThingName     string
	ThingArn      string
	ThingTypeName string
	Attributes    map[string]string
	Version       int64
	Principals    []string // attached certificate ARNs
}

type ThingGroup

type ThingGroup struct {
	ThingGroupName  string
	ThingGroupArn   string
	Properties      map[string]any
	ParentGroupName string
	Things          map[string]bool // thing names in this group
	CreationDate    time.Time
}

type ThingType

type ThingType struct {
	ThingTypeName string
	ThingTypeArn  string
	Properties    map[string]any
	CreationDate  time.Time
	Deprecated    bool
}

type TopicRule

type TopicRule struct {
	RuleName     string
	RuleArn      string
	Sql          string
	Description  string
	Actions      []map[string]any
	RuleDisabled bool
	CreationDate time.Time
}

Jump to

Keyboard shortcuts

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