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
@@ -40,7 +40,7 @@ type dialSettings struct {
timeout time.Duration
}
// commandDial returns the "ws dial" command, which opens a WebSocket on the
// commandDial returns the "dial" command, which opens a WebSocket on the
// HTTP server's /ws path, sends messages and prints the replies.
func commandDial(opts *cli.Options) *cobra.Command {
cmd := &cobra.Command{
@@ -67,14 +67,14 @@ server.tls.enabled is set). Set --origin to test the Origin check: an upgrade
from an origin that isn't the server's own or one of
server.csrf.cross_origin_protection.trusted_origins is refused with 403.`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
slog.Debug("command persistent pre-run", "command", "ws.dial")
slog.Debug("command persistent pre-run", "command", "dial")
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
slog.Debug("command persistent post-run", "command", "ws.dial")
slog.Debug("command persistent post-run", "command", "dial")
},
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
slog.Debug("command run", "command", "ws.dial")
slog.Debug("command run", "command", "dial")
settings, err := dialFlags(cmd)
if err != nil {