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.

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