Numpy-Neuron / request /request.go
Jensen-holm's picture
re configured the Alg interface and the NN sttuct, now we have to work
a4aa491
raw
history blame
570 Bytes
package request
import (
"fmt"
"github.com/go-gota/gota/dataframe"
"github.com/gofiber/fiber/v2"
)
type Payload struct {
CSVData string `json:"csv_data"`
Features []string `json:"features"`
Target string `json:"target"`
Algorithm string `json:"algorithm"`
Args map[string]interface{} `json:"args"`
Df dataframe.DataFrame
}
func (p *Payload) SetDf(df dataframe.DataFrame) {
p.Df = df
}
func NewPayload(dest *Payload, c *fiber.Ctx) error {
if err := c.BodyParser(dest); err != nil {
return fmt.Errorf("invalid JSON data")
}
return nil
}