fullstack-lang / gong

Gong (go+ng) is a go sub-language that compiles to go and angular. All valid go is valid gong and vice versa. Gong enables fast development of web applications. Gong is model centric and by default, a UML diagram editor of the model is embedded in each application.
MIT License
11 stars 1 forks source link

Send back repo content via web socket #468

Closed thomaspeugeot closed 5 months ago

thomaspeugeot commented 6 months ago

Steps:

thomaspeugeot commented 6 months ago

currently, when a GET is performed, AstructDBs are copied into AstructAPI.

    // slice that will be transmitted to the front
    astructAPIs := make([]orm.AstructAPI, 0)

    // for each astruct, update fields from the database nullable fields
    for idx := range astructDBs {
        astructDB := &astructDBs[idx]
        _ = astructDB
        var astructAPI orm.AstructAPI

        // insertion point for updating fields
        astructAPI.ID = astructDB.ID
        astructDB.CopyBasicFieldsToAstruct_WOP(&astructAPI.Astruct_WOP)
        astructAPI.AstructPointersEncoding = astructDB.AstructPointersEncoding
        astructAPIs = append(astructAPIs, astructAPI)
    }

    c.JSON(http.StatusOK, astructAPIs)

one needs to perform the same thing when web socketing