httphandlers

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokenIDParam is the parameter name for the vehilce 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 VINVCController

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

VINVCController handles VIN VC-related http requests.

func NewVCController

func NewVCController(vinService VINVCService, telemetryURL string) (*VINVCController, error)

NewVCController creates a new http VCController.

func (*VINVCController) GetJSONLDDoc

func (v *VINVCController) GetJSONLDDoc(fiberCtx *fiber.Ctx) error

@Summary Get JSON-LD document @Description Returns the JSON-LD document for all VC types. @Tags VINVC @Accept json @Produce json @Success 200 {object} json.RawMessage @Router /v1/vc/context [get]

func (*VINVCController) GetPublicKeyDoc

func (v *VINVCController) GetPublicKeyDoc(fiberCtx *fiber.Ctx) error

@Summary Get verification control document @Description Returns the public key document for verifying VCs. @Tags VINVC @Accept json @Produce json @Success 200 {object} verifiable.VerificationControlDocument @Router /v1/vc/keys [get]

func (*VINVCController) GetVCStatus

func (v *VINVCController) GetVCStatus(fiberCtx *fiber.Ctx) error

@Summary Get VC Status @Description Get the VC status for a given status group (currently this is just the vehcilesTokenId) @Tags VINVC @Accept json @Produce json @Param group path int true "status list group" @Success 200 {object} verifiable.Credential @Router /v1/vc/status/{group} [get]

func (*VINVCController) GetVINVC

func (v *VINVCController) GetVINVC(fiberCtx *fiber.Ctx) error

@Summary Get VIN VC @Description Get the VIN VC for a given token Id of a vehicle NFT. If a unexpired VC is not found, a new VC is generated. @Tags VINVC @Accept json @Produce json @Param tokenId path int true "token Id of the vehicle NFT" @Param force query bool false "force generation of a new VC even if an unexpired VC exists" @Success 200 {object} getVINVCResponse @Security BearerAuth @Router /v1/vc/vin/{tokenId} [post]

func (*VINVCController) GetVocabDoc

func (v *VINVCController) GetVocabDoc(fiberCtx *fiber.Ctx) error

@Summary Get vocabulary document @Description Returns the vocabulary document for all VC types. @Tags VINVC @Accept json @Produce html @Success 200 {string} string @Router /v1/vc/context/vocab [get]

type VINVCService

type VINVCService interface {
	GetOrCreateVC(ctx context.Context, tokenID uint32, force bool) error
	GenerateStatusVC(tokenID uint32) (json.RawMessage, error)
	GenerateKeyControlDocument() (json.RawMessage, error)
	GenerateJSONLDDocument() (json.RawMessage, error)
	GenerateVocabDocument() (json.RawMessage, error)
}

VINVCService defines the interface for VIN VC operations.

Jump to

Keyboard shortcuts

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