Documentation
¶
Index ¶
Constants ¶
View Source
const (
WebsocketJavascriptBlock = `` /* 607-byte string literal not displayed */
)
This constant provides the script block for HTML pages to connect to desired websocket.
Variables ¶
This section is empty.
Functions ¶
func WebsocketServerHandler ¶
func WebsocketServerHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type ReactiveVar ¶
type ReactiveVar struct {
Identifier string
Value string
// contains filtered or unexported fields
}
ReactiveVar stores string data in a concurrency-safe way.
func NewReactiveVar ¶
func NewReactiveVar(value string) *ReactiveVar
func (*ReactiveVar) String ¶
func (r *ReactiveVar) String() string
String formats the ReactiveVar as a HTML span for direct usage in HTML templates.
func (*ReactiveVar) Update ¶
func (r *ReactiveVar) Update(newValue string)
Update provides a concurrency-safe way to update the value owned by a ReactiveVar, and triggers a change notification to all subscribed clients.
Click to show internal directories.
Click to hide internal directories.