httphandlers

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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 POMVCService interface {
	CreatePOMVC(ctx context.Context, tokenID uint32) error
}

type VINVCService

type VINVCService interface {
	CreateAndStoreVINAttestation(ctx context.Context, tokenID uint32) (*cloudevent.RawEvent, error)
}

VINVCService defines the interface for VIN VC operations.

type VehicleHealthVCService added in v0.1.8

type VehicleHealthVCService interface {
	CreateVehicleHealthVC(ctx context.Context, tokenID uint32, startTime, endTime time.Time, jwtToken string) error
}

VehicleHealthVCService defines the interface for VehicleHealthVC operations.

type VehiclePositionVCService added in v0.1.8

type VehiclePositionVCService interface {
	CreateVehiclePositionVC(ctx context.Context, tokenID uint32, timestamp time.Time, jwtToken string) error
}

VehiclePositionVCService defines the interface for VehiclePositionVC operations.

Jump to

Keyboard shortcuts

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