Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPagePath []string = []string{
"", "/", "/index.html",
}
View Source
var DefaultPageTmpl string
Functions ¶
func RegisterPage ¶
RegisterPage registers a page function to handle HTTP requests for the specified path patterns.
Parameters: - pn: The page function to register. - path: Additional path patterns to register the page function for. if set to "", the caller's filename will be used. e.g. "index.go"-> "index.html"
Return: - string: The WebSocket URL path for the registered page.
Types ¶
type CbDataType ¶
type CbDataType byte
const ( CbDataTypeString CbDataType = iota CbDataTypeBinary )
type IAfterLoaded ¶ added in v0.1.2
type IAfterLoaded interface {
AfterElementLoadedFromFramwork(p Page)
}
type IContainerID ¶ added in v0.1.7
type IContainerID interface {
ContainerID() string
}
type IMessageCb ¶
type IMessageCb interface {
MessageCallbackFromFramwork(page Page, id string, dataType CbDataType, data []byte) bool
}
type Page ¶
type Page interface { Title(string) Page AddJs(string) Page AddCss(string) Page RunJs(js string) Page Write(any) string WriteWithID(string, any) string Delete(string) SetAttr(id, key, value string) string GetPeer() string Close() WaitUntilClosed() // regist element event after loaded RegistEvent(id, typ string, cb IMessageCb) SetEnv(key string, value any) GetEnv(key string) any WatchEnv(key string, cb func(value any)) error }
Click to show internal directories.
Click to hide internal directories.