Первая версия (CLI-only) #1

Merged
weirdcat merged 26 commits from develop into main 2025-11-27 13:09:27 +03:00
4 changed files with 24 additions and 23 deletions
Showing only changes of commit f6ef335a53 - Show all commits

View File

@@ -24,7 +24,7 @@ import (
"git.weirdcat.su/weirdcat/auto-attendance/internal/config" "git.weirdcat.su/weirdcat/auto-attendance/internal/config"
"git.weirdcat.su/weirdcat/auto-attendance/internal/linkvalidator" "git.weirdcat.su/weirdcat/auto-attendance/internal/linkvalidator"
"git.weirdcat.su/weirdcat/auto-attendance/internal/logger" "git.weirdcat.su/weirdcat/auto-attendance/internal/logger"
"git.weirdcat.su/weirdcat/auto-attendance/internal/qrminator" "git.weirdcat.su/weirdcat/auto-attendance/internal/app"
"git.weirdcat.su/weirdcat/auto-attendance/internal/screencapturer" "git.weirdcat.su/weirdcat/auto-attendance/internal/screencapturer"
"git.weirdcat.su/weirdcat/auto-attendance/internal/vision" "git.weirdcat.su/weirdcat/auto-attendance/internal/vision"
"go.uber.org/fx" "go.uber.org/fx"
@@ -39,9 +39,9 @@ func main() {
browserlauncher.NewBrowserLauncher, browserlauncher.NewBrowserLauncher,
screencapturer.NewWholeScreenCapturer, screencapturer.NewWholeScreenCapturer,
vision.NewVision, vision.NewVision,
qrminator.NewQrminator, app.NewApp,
), ),
fx.Invoke(func(qrm qrminator.Qrminator) { fx.Invoke(func(qrm app.App) {
}), }),
) )

View File

@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
package qrminator package app
import ( import (
"sync" "sync"
@@ -30,7 +30,7 @@ import (
"git.weirdcat.su/weirdcat/auto-attendance/internal/vision" "git.weirdcat.su/weirdcat/auto-attendance/internal/vision"
) )
type Qrminator interface { type App interface {
Init() error Init() error
Start() error Start() error
Stop() error Stop() error
@@ -39,7 +39,7 @@ type Qrminator interface {
UpdateConfig(string) error UpdateConfig(string) error
} }
type qrminatorImpl struct { type appImpl struct {
config *config.Config config *config.Config
log *logger.Logger log *logger.Logger
capturer screencapturer.ScreenCapturer capturer screencapturer.ScreenCapturer
@@ -52,45 +52,46 @@ type qrminatorImpl struct {
mu sync.Mutex mu sync.Mutex
} }
// ConsoleOutput implements Qrminator. // ConsoleOutput implements App.
func (q *qrminatorImpl) ConsoleOutput() (string, error) { func (a *appImpl) ConsoleOutput() (string, error) {
// TODO: Outputing stdout/logs content
panic("unimplemented") panic("unimplemented")
} }
// Init implements Qrminator. // Init implements App.
func (q *qrminatorImpl) Init() error { func (a *appImpl) Init() error {
panic("unimplemented") panic("unimplemented")
} }
// Start implements Qrminator. // Start implements App.
func (q *qrminatorImpl) Start() error { func (a *appImpl) Start() error {
panic("unimplemented") panic("unimplemented")
} }
// Stop implements Qrminator. // Stop implements App.
func (q *qrminatorImpl) Stop() error { func (a *appImpl) Stop() error {
panic("unimplemented") panic("unimplemented")
} }
// Toggle implements Qrminator. // Toggle implements App.
func (q *qrminatorImpl) Toggle() error { func (a *appImpl) Toggle() error {
panic("unimplemented") panic("unimplemented")
} }
// UpdateConfig implements Qrminator. // UpdateConfig implements App.
func (q *qrminatorImpl) UpdateConfig(string) error { func (a *appImpl) UpdateConfig(string) error {
panic("unimplemented") panic("unimplemented")
} }
func NewQrminator( func NewApp(
cfg *config.Config, cfg *config.Config,
log *logger.Logger, log *logger.Logger,
capt screencapturer.ScreenCapturer, capt screencapturer.ScreenCapturer,
vis vision.Vision, vis vision.Vision,
val linkvalidator.LinkValidator, val linkvalidator.LinkValidator,
launch browserlauncher.BrowserLauncher, launch browserlauncher.BrowserLauncher,
) Qrminator { ) App {
return &qrminatorImpl{ return &appImpl{
config: cfg, config: cfg,
log: log, log: log,
capturer: capt, capturer: capt,

View File

@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
package qrminator package app
import "time" import "time"

View File

@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
package qrminator package app
type QrminatorStatus int16 type QrminatorStatus int16