func (f *handler) GetTriggers(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
	res := []trigger.Config{}
	for _, trgr := range agent.New().GetTriggers() {
		res = append(res, trgr.GetConfig())
	}
	w.Header().Set("Content-Type", "application/json")
	if err := json.NewEncoder(w).Encode(res); err != nil {
		f.Error(w, r, http.StatusInternalServerError, err)
	}
	return
}
GetTriggers will return the list of currently available triggers.
package backend
import (
	"encoding/json"
	"fmt"
	"net/http"
	"strconv"
	"strings"
	"github.com/julienschmidt/httprouter"
	"github.com/joyrex2001/nightshift/internal/agent"
	"github.com/joyrex2001/nightshift/internal/config"
	"github.com/joyrex2001/nightshift/internal/metrics"
	"github.com/joyrex2001/nightshift/internal/scanner"
	"github.com/joyrex2001/nightshift/internal/trigger"
)
func (f *handler) GetVersion(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
	res := struct {
		Version string `json:"version"`
		Build   string `json:"build"`
		Date    string `json:"date"`
	}{
		Version: config.Version,
		Build:   config.Build,
		Date:    config.Date,
	}
	w.Header().Set("Content-Type", "application/json")
	if err := json.NewEncoder(w).Encode(res); err != nil {
		f.Error(w, r, http.StatusInternalServerError, err)
	}
	return
}
func (f *handler) GetObjects(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
	res := []*scanner.Object{}
	for _, obj := range agent.New().GetObjects() {
		if len(obj.Schedule) > 0 {
			res = append(res, obj)
		}
	}
	w.Header().Set("Content-Type", "application/json")
	if err := json.NewEncoder(w).Encode(res); err != nil {
		f.Error(w, r, http.StatusInternalServerError, err)
	}
	return
}
func (f *handler) GetScanners(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
	res := []scanner.Config{}
	for _, scnr := range agent.New().GetScanners() {
		res = append(res, scnr.GetConfig())
	}
	w.Header().Set("Content-Type", "application/json")
	if err := json.NewEncoder(w).Encode(res); err != nil {
		f.Error(w, r, http.StatusInternalServerError, err)
	}
	return
}