cleanup
This commit is contained in:
parent
94a7e36297
commit
cd180a6d8c
12 changed files with 16 additions and 11 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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"),
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue