Initial commit
All checks were successful
golangci-lint / lint (push) Successful in 19m8s

This commit is contained in:
2024-08-25 16:40:48 +02:00
commit 12fbb06666
20 changed files with 612 additions and 0 deletions

36
service/service.go Normal file
View File

@ -0,0 +1,36 @@
package service
import (
"sync"
"time"
"git.vbrandl.net/vbrandl/go-web-template/common"
)
type Service struct {
BackgroundJobsStarted bool
ServiceMutex sync.Mutex
StartTime time.Time
Config common.Config
}
func New(config common.Config) *Service {
ser := &Service{
BackgroundJobsStarted: false,
ServiceMutex: sync.Mutex{},
StartTime: time.Now(),
Config: config,
}
ser.StartBackground()
return ser
}
func (ser *Service) StartBackground() {
ser.ServiceMutex.Lock()
defer ser.ServiceMutex.Unlock()
ser.BackgroundJobsStarted = true
// TODO: start jobs
}