Split ws from jobsearch as a separate test utility rather than a feature of jobsearch

This commit is contained in:
bwilliams committed 2026-10-16 08:58:25 +01:00
1 parent b714ee14d5
commit 5e61c11eb9
9 files changed
+148 -38

No files matched your search

+4 -4
View File
@@ -18,20 +18,20 @@ import (
"git.avsdev.uk/Go/job-search/internal/websocket/tcpserver"
)
// commandServe returns the "ws serve" command, which runs a plain TCP server
// commandServe returns the "serve" command, which runs a plain TCP server
// for websocket hub clients (see tcpserver).
func commandServe(opts *cli.Options) *cobra.Command {
cmd := &cobra.Command{
Use: "serve",
Short: "Run JobSearch TCP Websocket server",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
slog.Debug("command persistent pre-run", "command", "ws.serve")
slog.Debug("command persistent pre-run", "command", "serve")
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
slog.Debug("command persistent post-run", "command", "ws.serve")
slog.Debug("command persistent post-run", "command", "serve")
},
RunE: func(cmd *cobra.Command, args []string) error {
slog.Debug("command run", "command", "ws.serve")
slog.Debug("command run", "command", "serve")
addrOverride, _ := cmd.Flags().GetString("listen")
hostOverride, _ := cmd.Flags().GetString("host")