updated ipbl websocket feat

This commit is contained in:
Paul 2023-04-09 17:38:19 +02:00
parent 14d72693dd
commit abc02caf92
2 changed files with 1 additions and 22 deletions

View File

@ -94,15 +94,6 @@ func InsertOrUpdateSets(cfg config.Config, folders []CfgSet) (res string, err er
return return
} }
func GetZMQ(cfg config.Config) (res []CfgZMQ, err error) {
var w = []CfgZMQ{}
if err = cfg.Db.Find(&w); err == nil {
return w, err
}
return
}
func GetWS(cfg config.Config) (res []CfgWS, err error) { func GetWS(cfg config.Config) (res []CfgWS, err error) {
var w = []CfgWS{} var w = []CfgWS{}
@ -149,14 +140,6 @@ type CfgTrustlist struct {
IP string `xorm:"text notnull" json:"ip"` IP string `xorm:"text notnull" json:"ip"`
} }
type CfgZMQ struct {
ID int `xorm:"pk autoincr" json:"-"`
Type string `xorm:"text notnull" json:"type"`
Hostname string `xorm:"text notnull" json:"hostname"`
Port int `json:"port"`
Subscription string `json:"subscription"`
}
type CfgWS struct { type CfgWS struct {
ID int `xorm:"pk autoincr" json:"-"` ID int `xorm:"pk autoincr" json:"-"`
Type string `xorm:"text notnull" json:"type"` Type string `xorm:"text notnull" json:"type"`

View File

@ -86,7 +86,7 @@ func RegisterRoutes(e *echo.Echo, ctx *context.Context, cfg *config.Config) {
ips = append(ips, *ip) ips = append(ips, *ip)
} }
numinsert, numupdate, _ := models.InsertIPBulk(session, &ips) numinsert, numupdate, _ := models.InsertIPBulk(session, &ips)
msg = fmt.Sprintf("zmq: Inserted %d IP, Updated %d IP", numinsert, numupdate) msg = fmt.Sprintf("Inserted %d IP, Updated %d IP", numinsert, numupdate)
log.Println(msg) log.Println(msg)
return Result(c, err, msg) return Result(c, err, msg)
}) })
@ -142,10 +142,6 @@ func RegisterRoutes(e *echo.Echo, ctx *context.Context, cfg *config.Config) {
sets, err := models.GetSets(*cfg) sets, err := models.GetSets(*cfg)
return Result(c, err, sets) return Result(c, err, sets)
}) })
e.GET("/config/zmq", func(c echo.Context) (err error) {
folders, err := models.GetZMQ(*cfg)
return Result(c, err, folders)
})
e.GET("/config/ws", func(c echo.Context) (err error) { e.GET("/config/ws", func(c echo.Context) (err error) {
folders, err := models.GetWS(*cfg) folders, err := models.GetWS(*cfg)
return Result(c, err, folders) return Result(c, err, folders)