httphandler

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Packagge httphandler provides the HTTP handler for the fetch service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler is the HTTP handler for the fetch service.

func NewHandler

func NewHandler(logger *zerolog.Logger, chConn clickhouse.Conn, s3Client *s3.Client,
	cloudEventBucket, ephemeralBucket string,
	vehicleAddr common.Address, chainID uint64,
) *Handler

NewHandler creates a new Handler instance.

func (*Handler) GetIndexKeys

func (h *Handler) GetIndexKeys(fCtx *fiber.Ctx) error

GetIndexKeys handles requests for multiple index keys @Summary Get multiple index keys based on search criteria @Description Retrieves a list of index keys that match the provided search options @Tags objects @Accept json @Produce json @Param params query searchParams false "Search parameters" @Param tokenId path string true "Token ID" @Success 200 {object} []cloudReturn "Returns list of index keys" @Failure 400 {object} map[string]string "Invalid request" @Failure 500 {object} map[string]string "Server error" @Router /v1/vehicle/index-keys/{tokenId} [get]

func (*Handler) GetLatestIndexKey

func (h *Handler) GetLatestIndexKey(fCtx *fiber.Ctx) error

GetLatestIndexKey handles requests for the latest index key @Summary Get the latest index key based on search criteria @Description Retrieves the most recent index key that matches the provided search options @Tags objects @Accept json @Produce json @Param params query searchParams false "Search parameters" @Param tokenId path string true "Token ID" @Success 200 {object} cloudReturn "Returns the latest index key" @Failure 400 {object} map[string]string "Invalid request" @Failure 500 {object} map[string]string "Server error" @Router /v1/vehicle/latest-index-key/{tokenId} [get]

func (*Handler) GetLatestObject

func (h *Handler) GetLatestObject(fCtx *fiber.Ctx) error

GetLatestObject handles requests for the latest object @Summary Get the latest object based on search criteria @Description Retrieves the content of the most recent object that matches the provided search options @Tags objects @Accept json @Produce json @Param params query searchParams false "Search parameters" @Param tokenId path string true "Token ID" @Success 200 {object} cloudevent.CloudEvent[json.RawMessage] "Returns latest object data" @Failure 400 {object} map[string]string "Invalid request" @Failure 500 {object} map[string]string "Server error" @Router /v1/vehicle/latest-object/{tokenId} [get]

func (*Handler) GetObjects

func (h *Handler) GetObjects(fCtx *fiber.Ctx) error

GetObjects handles requests for multiple objects @Summary Get multiple objects based on search criteria @Description Retrieves the content of multiple objects that match the provided search options @Tags objects @Accept json @Produce json @Param params query searchParams false "Search parameters" @Param tokenId path string true "Token ID" @Success 200 {object} []cloudevent.CloudEvent[json.RawMessage] "Returns latest object data" @Failure 400 {object} map[string]string "Invalid request" @Failure 500 {object} map[string]string "Server error" @Router /v1/vehicle/objects/{tokenId} [get]

Jump to

Keyboard shortcuts

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