deviceapi

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotFoundError

type NotFoundError struct {
	DeviceID string
	TokenId  uint32
}

NotFoundError is an error type for when a device's token is not found.

func (NotFoundError) Error

func (e NotFoundError) Error() string

Error returns the error message for a NotFoundError.

func (NotFoundError) Is

func (e NotFoundError) Is(target error) bool

Is checks if the target error is a NotFoundError.

type Service

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

func NewService

func NewService(devicesConn *grpc.ClientConn) *Service

NewService API wrapper to call device-telemetry-api to get the userDevices associated with a userId over grpc

func (*Service) PrimeTokenIDCache

func (s *Service) PrimeTokenIDCache(ctx context.Context, tokenID uint32, id string)

Prime caches the tokenID and subject for a userDevice.

func (*Service) SubjectFromTokenID

func (s *Service) SubjectFromTokenID(ctx context.Context, tokenID uint32) (string, error)

SubjectFromTokenID gets the subject from the tokenID for a vehicle NFT

func (*Service) TokenIDFromSubject

func (s *Service) TokenIDFromSubject(ctx context.Context, id string) (uint32, error)

TokenIDFromSubject gets the tokenID from the subject for a userDevice

Jump to

Keyboard shortcuts

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