update tracking

This commit is contained in:
Fran Jurmanović
2025-05-26 20:55:22 +02:00
parent edf5a2c8c4
commit e52894c663
5 changed files with 186 additions and 58 deletions

View File

@@ -0,0 +1,26 @@
package regexHandler
import (
"acc-server-manager/local/model"
"regexp"
)
type AccServerInstance struct {
Model *model.Server
State *model.ServerState
}
type RegexHandler struct {
regex *regexp.Regexp
}
func (rh *RegexHandler) Contains(line string, callback func(...string)) {
match := rh.regex.FindStringSubmatch(line)
callback(match...)
}
func New(str string) *RegexHandler {
return &RegexHandler{
regex: regexp.MustCompile(str),
}
}