Documentation
¶
Index ¶
- Constants
- type CreateOdometerStatementVCRequest
- type CreateVehicleHealthVCRequest
- type CreateVehiclePositionVCRequest
- type HTTPController
- func (v *HTTPController) CreateOdometerStatementAttestation(fiberCtx *fiber.Ctx) error
- func (v *HTTPController) CreateVINAttestation(fiberCtx *fiber.Ctx) error
- func (v *HTTPController) CreateVehicleHealthAttestation(fiberCtx *fiber.Ctx) error
- func (v *HTTPController) CreateVehiclePositionAttestation(fiberCtx *fiber.Ctx) error
- type OdometerStatementVCService
- type POMVCService
- type VINVCService
- type VehicleHealthVCService
- type VehiclePositionVCService
Constants ¶
const ( // TokenIDParam is the parameter name for the vehicle token id. TokenIDParam = "tokenId" // StatusGroupParam is the parameter name for the status group. StatusGroupParam = "group" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateOdometerStatementVCRequest ¶ added in v0.1.8
type CreateOdometerStatementVCRequest struct {
Timestamp *time.Time `json:"timestamp,omitempty" example:"2021-01-01T00:00:00Z"` // Optional timestamp
}
CreateOdometerStatementVCRequest represents the request body for creating an OdometerStatementVC.
type CreateVehicleHealthVCRequest ¶ added in v0.1.8
type CreateVehicleHealthVCRequest struct {
StartTime time.Time `json:"startTime" validate:"required" example:"2021-01-01T00:00:00Z"`
EndTime time.Time `json:"endTime" validate:"required" example:"2021-01-15T00:00:00Z"`
}
CreateVehicleHealthVCRequest represents the request body for creating a VehicleHealthVC.
type CreateVehiclePositionVCRequest ¶ added in v0.1.8
type CreateVehiclePositionVCRequest struct {
Timestamp time.Time `json:"timestamp" validate:"required" example:"2021-01-01T00:00:00Z"`
}
CreateVehiclePositionVCRequest represents the request body for creating a VehiclePositionVC.
type HTTPController ¶ added in v0.0.6
type HTTPController struct {
// contains filtered or unexported fields
}
HTTPController handles VIN VC-related http requests.
func NewVCController ¶
func NewVCController(vinService VINVCService, pomService POMVCService, vehiclePositionService VehiclePositionVCService, odometerStatementService OdometerStatementVCService, vehicleHealthService VehicleHealthVCService, telemetryURL string) (*HTTPController, error)
NewVCController creates a new http VCController.
func (*HTTPController) CreateOdometerStatementAttestation ¶ added in v0.1.8
func (v *HTTPController) CreateOdometerStatementAttestation(fiberCtx *fiber.Ctx) error
@Summary Create Odometer Statement Attestation @Description Generate a new Odometer Statement attestation for a given token Id. If timestamp is not provided, uses the latest odometer reading. @Tags OdometerStatementVC @Accept json @Produce json @Param tokenId path int true "token Id of the vehicle NFT" @Param request body CreateOdometerStatementVCRequest false "Request body" @Success 200 {object} successResponse @Security BearerAuth @Router /v2/attestation/odometer-statement/{tokenId} [post]
func (*HTTPController) CreateVINAttestation ¶ added in v0.1.0
func (v *HTTPController) CreateVINAttestation(fiberCtx *fiber.Ctx) error
@Summary Create VIN Attestation @Description Generate a new VIN attestation for a given token Id of a vehicle NFT. @Tags VINVC @Accept json @Produce json @Param tokenId path int true "token Id of the vehicle NFT" @Success 200 {object} getVCResponse @Security BearerAuth @Router /v2/attestation/vin/{tokenId} [post]
func (*HTTPController) CreateVehicleHealthAttestation ¶ added in v0.1.8
func (v *HTTPController) CreateVehicleHealthAttestation(fiberCtx *fiber.Ctx) error
@Summary Create Vehicle Health Attestation @Description Generate a new Vehicle Health attestation for a given token Id and time range. The time range cannot exceed 30 days. @Tags VehicleHealthVC @Accept json @Produce json @Param tokenId path int true "token Id of the vehicle NFT" @Param request body CreateVehicleHealthVCRequest true "Request body" @Success 200 {object} successResponse @Security BearerAuth @Router /v2/attestation/vehicle-health/{tokenId} [post]
func (*HTTPController) CreateVehiclePositionAttestation ¶ added in v0.1.8
func (v *HTTPController) CreateVehiclePositionAttestation(fiberCtx *fiber.Ctx) error
@Summary Create Vehicle Position Attestation @Description Generate a new Vehicle Position attestation for a given token Id and timestamp. @Tags VehiclePositionVC @Accept json @Produce json @Param tokenId path int true "token Id of the vehicle NFT" @Param request body CreateVehiclePositionVCRequest true "Request body" @Success 200 {object} successResponse @Security BearerAuth @Router /v2/attestation/vehicle-position/{tokenId} [post]
type OdometerStatementVCService ¶ added in v0.1.8
type OdometerStatementVCService interface {
CreateOdometerStatementVC(ctx context.Context, tokenID uint32, timestamp *time.Time, jwtToken string) error
}
OdometerStatementVCService defines the interface for OdometerStatementVC operations.
type POMVCService ¶ added in v0.0.6
type VINVCService ¶
type VINVCService interface {
CreateAndStoreVINAttestation(ctx context.Context, tokenID uint32) (*cloudevent.RawEvent, error)
}
VINVCService defines the interface for VIN VC operations.