api

package
v0.0.0-...-3598874 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregator

func Aggregator(c *gin.Context)

Aggregator handles the aggregator endpoint for the API.

It parses the payload from the request body and verifies the signature. It checks if the timestamp is within the allowed range. It verifies if the task is finished and if the operator has already sent the task. If all checks pass, it saves the task to the queue. It returns an HTTP response with the status of the operation.

Parameters: - c: The gin.Context object representing the HTTP request and response.

Returns: - None.

func SetupRoutes

func SetupRoutes(router *gin.Engine)

SetupRoutes sets up routes for the aggregator API.

router is the Gin Engine instance used to set up the routes. No return values.

Types

type Payload

type Payload struct {
	TaskId    uint64 `json:"taskID" binding:"required"`
	Result    int64  `json:"result" binding:"required"`
	Timestamp int64  `json:"timestamp" binding:"required"`
	Signature string `json:"signature" binding:"required"`
	PubKey    string `json:"pubKey" binding:"required"`
}

Jump to

Keyboard shortcuts

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