Files
teletypegames/domain/service.software_updater.go
T
2026-01-28 19:05:40 +01:00

25 lines
611 B
Go

package domain
import (
"fmt"
)
type SoftwareUpdaterServiceInterface interface {
Update(platform, name, version string) error
}
type SoftwareUpdaterService struct {
tic80Updater SoftwareUpdaterTIC80ServiceInterface
}
func NewSoftwareUpdaterService(tic80_updater SoftwareUpdaterTIC80ServiceInterface) *SoftwareUpdaterService {
return &SoftwareUpdaterService{tic80Updater: tic80_updater}
}
func (s *SoftwareUpdaterService) Update(platform, name, version string) error {
if platform == "tic80" {
return s.tic80Updater.Update(name, version)
}
return fmt.Errorf("unsupported platform: %s", platform)
}