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 ¶
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 ¶
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 ¶
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 ¶
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]