mirror of
https://github.com/ditatompel/xmr-remote-nodes.git
synced 2024-12-31 16:09:54 +00:00
change MoneroNode and MoneroNodes handler name
MoneroNode -> Node MoneroNodes -> Nodes
This commit is contained in:
parent
9323e63405
commit
e01c28d966
2 changed files with 10 additions and 4 deletions
|
@ -7,7 +7,8 @@ import (
|
|||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func MoneroNode(c *fiber.Ctx) error {
|
||||
// Returns a single node information based on `id` query param
|
||||
func Node(c *fiber.Ctx) error {
|
||||
nodeId, err := c.ParamsInt("id", 0)
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusUnprocessableEntity).JSON(fiber.Map{
|
||||
|
@ -42,7 +43,8 @@ func MoneroNode(c *fiber.Ctx) error {
|
|||
})
|
||||
}
|
||||
|
||||
func MoneroNodes(c *fiber.Ctx) error {
|
||||
// Returns a list of nodes
|
||||
func Nodes(c *fiber.Ctx) error {
|
||||
moneroRepo := monero.New()
|
||||
query := monero.QueryNodes{
|
||||
RowsPerPage: c.QueryInt("limit", 10),
|
||||
|
|
|
@ -4,15 +4,19 @@ import (
|
|||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
// V1 API routes
|
||||
func V1Api(app *fiber.App) {
|
||||
v1 := app.Group("/api/v1")
|
||||
|
||||
v1.Get("/nodes", MoneroNodes)
|
||||
// these routes are public, they don't require a prober api key
|
||||
v1.Get("/nodes", Nodes)
|
||||
v1.Post("/nodes", AddNode)
|
||||
v1.Get("/nodes/id/:id", MoneroNode)
|
||||
v1.Get("/nodes/id/:id", Node)
|
||||
v1.Get("/nodes/logs", ProbeLogs)
|
||||
v1.Get("/fees", NetFees)
|
||||
v1.Get("/countries", Countries)
|
||||
|
||||
// these routes are for prober, they require a prober api key
|
||||
v1.Get("/job", CheckProber, GiveJob)
|
||||
v1.Post("/job", CheckProber, ProcessJob)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue