The backend for the project formerly known as signet, now known as beignet.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

12345678910111213141516171819202122
  1. package endpoints
  2. import (
  3. "encoding/json"
  4. . "github.com/imosed/signet/data"
  5. "net/http"
  6. )
  7. type GetQueuesResponse struct {
  8. Queues []Queue `json:"queues"`
  9. }
  10. func GetQueues(w http.ResponseWriter, r *http.Request) {
  11. var resp GetQueuesResponse
  12. Db.Table("queues").Scan(&resp.Queues)
  13. err := json.NewEncoder(w).Encode(resp)
  14. if err != nil {
  15. panic("Could not deliver response")
  16. }
  17. }