feat: refactor shared.Message to a channel
- remove `shared` package and shared.Message - rename `notifications` package to `frontend` - introduce a channel send the received ServerMessages to the frontend handler(s) - move keyhandler to goroutine - simplify password handling in Start function - update import names when importing from GoTomoto
This commit is contained in:
parent
cc24dd6775
commit
bbc9977f1c
10 changed files with 108 additions and 82 deletions
|
@ -1,7 +1,7 @@
|
|||
package helper
|
||||
|
||||
import (
|
||||
"git.smsvc.net/pomodoro/ChronoTomato/pkg/models"
|
||||
ChronoTomato "git.smsvc.net/pomodoro/ChronoTomato/pkg/models"
|
||||
"github.com/charmbracelet/log"
|
||||
"gopkg.in/yaml.v3"
|
||||
"os"
|
||||
|
@ -9,8 +9,8 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
func ParseConfig(filename string) models.ConfigFile {
|
||||
var config models.ConfigFile
|
||||
func ParseConfig(filename string) ChronoTomato.Config {
|
||||
var config ChronoTomato.Config
|
||||
if strings.HasPrefix(filename, "~/") {
|
||||
dirname, _ := os.UserHomeDir()
|
||||
filename = filepath.Join(dirname, filename[2:])
|
||||
|
@ -19,7 +19,7 @@ func ParseConfig(filename string) models.ConfigFile {
|
|||
if err != nil {
|
||||
log.Warn("Error opening config file!", "reason", err)
|
||||
log.Warn("Using defaults")
|
||||
return models.ConfigFile{
|
||||
return ChronoTomato.Config{
|
||||
URL: "ws://localhost:8080/ws",
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue