move InterfacetoType to types and deleted types as it was now empty
This commit is contained in:
@@ -2,7 +2,10 @@ package tasks
|
||||
|
||||
import (
|
||||
"github.com/LazyBachelor/LazyPM/internal/service"
|
||||
"github.com/LazyBachelor/LazyPM/pkg/cli/repl"
|
||||
"github.com/LazyBachelor/LazyPM/pkg/task"
|
||||
"github.com/LazyBachelor/LazyPM/pkg/tui"
|
||||
"github.com/LazyBachelor/LazyPM/pkg/web"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -14,3 +17,16 @@ func init() {
|
||||
return NewCodingTask(svc)
|
||||
})
|
||||
}
|
||||
|
||||
func InterfaceToType(it task.Interface) task.InterfaceType {
|
||||
switch it.(type) {
|
||||
case *repl.REPL:
|
||||
return task.InterfaceCLI
|
||||
case *tui.Tui:
|
||||
return task.InterfaceTUI
|
||||
case *web.Web:
|
||||
return task.InterfaceWeb
|
||||
default:
|
||||
return task.InterfaceType("unknown")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package tasks
|
||||
|
||||
import (
|
||||
"github.com/LazyBachelor/LazyPM/pkg/cli/repl"
|
||||
"github.com/LazyBachelor/LazyPM/pkg/task"
|
||||
"github.com/LazyBachelor/LazyPM/pkg/tui"
|
||||
"github.com/LazyBachelor/LazyPM/pkg/web"
|
||||
)
|
||||
|
||||
const (
|
||||
InterfaceTUI task.InterfaceType = "tui"
|
||||
InterfaceCLI task.InterfaceType = "repl"
|
||||
InterfaceWeb task.InterfaceType = "web"
|
||||
)
|
||||
|
||||
func InterfaceToType(it task.Interface) task.InterfaceType {
|
||||
switch it.(type) {
|
||||
case *repl.REPL:
|
||||
return InterfaceCLI
|
||||
case *tui.Tui:
|
||||
return InterfaceTUI
|
||||
case *web.Web:
|
||||
return InterfaceWeb
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user