Documentation ¶
Overview ¶
Package vinvc provides the controller for handling VIN VC-related requests.
Index ¶
- Constants
- type FingerprintRepo
- type IdentityAPI
- type Issuer
- type Service
- func (v *Service) GenerateJSONLDDocument() (json.RawMessage, error)
- func (v *Service) GenerateKeyControlDocument() (json.RawMessage, error)
- func (v *Service) GenerateStatusVC(tokenID uint32) (json.RawMessage, error)
- func (v *Service) GenerateVINVC(ctx context.Context, tokenID uint32, logger *zerolog.Logger) error
- func (v *Service) GenerateVocabDocument() (json.RawMessage, error)
- func (v *Service) GetOrCreateVC(ctx context.Context, tokenID uint32, force bool) error
- type VCRepo
- type VINAPI
Constants ¶
View Source
const (
PolygonChainID = 137
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FingerprintRepo ¶
type FingerprintRepo interface {
GetLatestFingerprintMessages(ctx context.Context, vehicle cloudevent.NFTDID, 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.NFTDID) (*models.VehicleInfo, error)
}
IdentityAPI defines the interface for identity operations.
type Issuer ¶
type Issuer interface { CreateBitstringStatusListVC(tokenID uint32, revoked bool) ([]byte, error) CreateKeyControlDoc() ([]byte, error) CreateVINVC(vinSubject verifiable.VINSubject, expTime time.Time) ([]byte, error) CreateJSONLDDoc() ([]byte, error) CreateVocabWebpage() ([]byte, error) }
Issuer defines the interface for creating control documents.
type Service ¶
type Service struct {
// 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, issuer Issuer, revokedList []uint32, vehicleNFTAddress string, ) *Service
NewService creates a new Service for VIN VC operations.
func (*Service) GenerateJSONLDDocument ¶
func (v *Service) GenerateJSONLDDocument() (json.RawMessage, error)
func (*Service) GenerateKeyControlDocument ¶
func (v *Service) GenerateKeyControlDocument() (json.RawMessage, error)
GenerateKeyControlDocument generates a new control document for sharing public keys.
func (*Service) GenerateStatusVC ¶
func (v *Service) GenerateStatusVC(tokenID uint32) (json.RawMessage, error)
GenerateStatusVC generates a new status VC.
func (*Service) GenerateVINVC ¶
func (*Service) GenerateVocabDocument ¶
func (v *Service) GenerateVocabDocument() (json.RawMessage, error)
type VCRepo ¶
type VCRepo interface { GetLatestVINVC(ctx context.Context, vehicleDID cloudevent.NFTDID) (*verifiable.Credential, error) StoreVINVC(ctx context.Context, vehicleDID, producerDID cloudevent.NFTDID, vinvc json.RawMessage) error }
VCRepo defines the interface for manging VC storage.
Click to show internal directories.
Click to hide internal directories.