MCPcopy
hub / github.com/pocketbase/pocketbase / NewRouter

Function NewRouter

tools/router/router.go:53–58  ·  view source on GitHub ↗

NewRouter creates a new Router instance with the provided event factory function.

(eventFactory EventFactoryFunc[T])

Source from the content-addressed store, hash-verified

51
52// NewRouter creates a new Router instance with the provided event factory function.
53func NewRouter[T hook.Resolver](eventFactory EventFactoryFunc[T]) *Router[T] {
54 return &Router[T]{
55 RouterGroup: &RouterGroup[T]{},
56 eventFactory: eventFactory,
57 }
58}
59
60// BuildMux constructs a new mux [http.Handler] instance from the current router configurations.
61func (r *Router[T]) BuildMux() (http.Handler, error) {

Callers 3

TestRouterFunction · 0.92
TestRouterUnbindFunction · 0.92
NewRouterFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestRouterFunction · 0.74
TestRouterUnbindFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…