This commit is contained in:
maddalax 2024-11-09 11:53:33 -06:00
parent 94a7e36297
commit cd180a6d8c
12 changed files with 16 additions and 11 deletions

View file

@ -3,9 +3,9 @@ package main
import (
"github.com/maddalax/htmgo/extensions/websocket"
ws2 "github.com/maddalax/htmgo/extensions/websocket/opts"
"github.com/maddalax/htmgo/extensions/websocket/session"
"github.com/maddalax/htmgo/framework/h"
"github.com/maddalax/htmgo/framework/service"
"github.com/maddalax/htmgo/framework/session"
"io/fs"
"net/http"
"ws-example/__htmgo"

View file

@ -2,9 +2,9 @@ package pages
import (
"fmt"
"github.com/maddalax/htmgo/extensions/websocket/session"
"github.com/maddalax/htmgo/extensions/websocket/ws"
"github.com/maddalax/htmgo/framework/h"
"github.com/maddalax/htmgo/framework/session"
"ws-example/partials"
)

View file

@ -6,7 +6,12 @@ import (
func RootPage(ctx *h.RequestContext, children ...h.Ren) h.Ren {
return h.Html(
h.HxExtension(h.BaseExtensions()),
h.JoinExtensions(
h.HxExtension(
h.BaseExtensions(),
),
h.HxExtension("ws"),
),
h.Head(
h.Link("/public/main.css", "stylesheet"),
h.Script("/public/htmgo.js"),

View file

@ -2,9 +2,9 @@ package ws
import (
"fmt"
"github.com/maddalax/htmgo/extensions/websocket/session"
"github.com/maddalax/htmgo/extensions/websocket/ws"
"github.com/maddalax/htmgo/framework/h"
"github.com/maddalax/htmgo/framework/session"
"runtime"
"time"
"ws-example/pages"

View file

@ -1,9 +1,9 @@
package partials
import (
"github.com/maddalax/htmgo/extensions/websocket/session"
"github.com/maddalax/htmgo/extensions/websocket/ws"
"github.com/maddalax/htmgo/framework/h"
"github.com/maddalax/htmgo/framework/session"
)
type Counter struct {

View file

@ -2,9 +2,9 @@ package ws
import (
"github.com/maddalax/htmgo/extensions/websocket/internal/wsutil"
"github.com/maddalax/htmgo/extensions/websocket/session"
"github.com/maddalax/htmgo/framework/h"
"github.com/maddalax/htmgo/framework/service"
"github.com/maddalax/htmgo/framework/session"
)
// PushServerSideEvent sends a server side event this specific session

View file

@ -2,9 +2,9 @@ package ws
import (
"github.com/maddalax/htmgo/extensions/websocket/internal/wsutil"
"github.com/maddalax/htmgo/extensions/websocket/session"
"github.com/maddalax/htmgo/framework/h"
"github.com/maddalax/htmgo/framework/service"
"github.com/maddalax/htmgo/framework/session"
"time"
)

View file

@ -3,7 +3,7 @@ package ws
import (
"fmt"
"github.com/maddalax/htmgo/extensions/websocket/internal/wsutil"
"github.com/maddalax/htmgo/framework/session"
"github.com/maddalax/htmgo/extensions/websocket/session"
"sync"
)

View file

@ -2,8 +2,8 @@ package ws
import (
"github.com/maddalax/htmgo/extensions/websocket/internal/wsutil"
"github.com/maddalax/htmgo/extensions/websocket/session"
"github.com/maddalax/htmgo/framework/service"
"github.com/maddalax/htmgo/framework/session"
)
func StartListener(locator *service.Locator) {

View file

@ -2,8 +2,8 @@ package ws
import (
"github.com/maddalax/htmgo/extensions/websocket/internal/wsutil"
"github.com/maddalax/htmgo/extensions/websocket/session"
"github.com/maddalax/htmgo/framework/h"
"github.com/maddalax/htmgo/framework/session"
"github.com/puzpuzpuz/xsync/v3"
"sync"
"sync/atomic"

View file

@ -3,7 +3,7 @@ package h
import "strings"
func BaseExtensions() string {
extensions := []string{"path-deps", "response-targets", "mutation-error", "htmgo", "sse", "ws"}
extensions := []string{"path-deps", "response-targets", "mutation-error", "htmgo", "sse"}
if IsDevelopment() {
extensions = append(extensions, "livereload")
}