Versions in this module Expand all Collapse all v0 v0.1.0 Sep 27, 2023 Changes in this version + type ActionCtx struct + Args json.RawMessage + Request *http.Request + State json.RawMessage + Writer http.ResponseWriter + type ActionFunc func(c *ActionCtx) (*Update, error) + type Page interface + WriteHTML func(io.Writer) error + type PageCtx struct + Params httprouter.Params + Request *http.Request + Writer http.ResponseWriter + type PageFunc func(*PageCtx) (Page, error) + type Server struct + func New() *Server + func (s *Server) AddAction(name string, fn ActionFunc) + func (s *Server) AddFiles(baseURL string, fs http.FileSystem) + func (s *Server) AddPage(path string, fn PageFunc) + func (s *Server) AddStream(name string, fn StreamFunc) + func (s *Server) Router() *httprouter.Router + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + type StreamFunc func(ctx context.Context, args json.RawMessage, res chan<- *Update) error + type Update struct + Error *api.Error + HTML []api.HTMLUpdate + JS []api.JSCall + Name string + State any + Stream []api.Stream + URL string + func InsertAfter(selector, content string) *Update + func InsertBefore(selector, content string) *Update + func JSCall(name string, args any) *Update + func ReplaceContent(selector, content string) *Update + func ReplaceElement(selector, content string) *Update + func Stream(name string, args any) *Update + func (u *Update) AddInsertAfter(selector, content string) + func (u *Update) AddInsertBefore(selector, content string) + func (u *Update) AddJSCall(name string, args any) + func (u *Update) AddReplaceContent(selector, content string) + func (u *Update) AddReplaceElement(selector, content string) + func (u *Update) AddStream(name string, args any) + type UpdateablePage interface + Update func() (*Update, error)