vinvc

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package vinvc provides the controller for handling VIN VC-related requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FingerprintRepo

type FingerprintRepo interface {
	GetLatestFingerprintMessages(ctx context.Context, vehicle cloudevent.ERC721DID, pairedDeviceAddr models.PairedDevice) (*models.DecodedFingerprintData, error)
}

FingerprintRepo defines the interface for fingerprint message operations.

type IdentityAPI

type IdentityAPI interface {
	GetVehicleInfo(ctx context.Context, vehicleDID cloudevent.ERC721DID) (*models.VehicleInfo, error)
}

IdentityAPI defines the interface for identity operations.

type Service

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

Service handles VIN VC-related operations.

func NewService

func NewService(
	logger *zerolog.Logger,
	vcRepo VCRepo,
	identityService IdentityAPI,
	fingerprintService FingerprintRepo,
	vinService VINAPI,
	settings *config.Settings,
	privateKey *ecdsa.PrivateKey,
) *Service

NewService creates a new Service for VIN VC operations.

func (*Service) CreateAndStoreVINAttestation added in v0.1.0

func (v *Service) CreateAndStoreVINAttestation(ctx context.Context, tokenID uint32) (*cloudevent.RawEvent, error)

GenerateVINVCAndStore generates a new VIN VC and stores it in Object Storage.

func (*Service) CreateManualVINAttestation added in v0.1.0

func (v *Service) CreateManualVINAttestation(ctx context.Context, tokenID uint32, vin string, countryCode string) (*cloudevent.RawEvent, error)

func (*Service) CreateVINAttestation added in v0.1.0

func (v *Service) CreateVINAttestation(ctx context.Context, tokenID uint32) (*cloudevent.RawEvent, error)

GenerateVINVC generates a new VIN VC and returns it.

type VCRepo

type VCRepo interface {
	UploadAttestation(ctx context.Context, attestation *cloudevent.RawEvent) error
}

VCRepo defines the interface for manging VC storage.

type VINAPI

type VINAPI interface {
	DecodeVIN(ctx context.Context, vin, countryCode string) (string, error)
}

VINAPI defines the interface for VIN validation.

Jump to

Keyboard shortcuts

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