Documentation
¶
Index ¶
- func CleanupPath(basePath, targetPath string) string
- func WalkLayoutModel(m *s4wave_layout.LayoutModel, fn func(node any) bool)
- type AddTabFunc
- type LayoutResource
- func (r *LayoutResource) AddTab(ctx context.Context, req *s4wave_layout.AddTabRequest) (*s4wave_layout.AddTabResponse, error)
- func (r *LayoutResource) GetMux() srpc.Invoker
- func (r *LayoutResource) NavigateTab(ctx context.Context, req *s4wave_layout.NavigateTabRequest) (*s4wave_layout.NavigateTabResponse, error)
- func (r *LayoutResource) SetAddTabFunc(addTab AddTabFunc)
- func (r *LayoutResource) WatchLayoutModel(strm s4wave_layout.SRPCLayoutHost_WatchLayoutModelStream) error
- type NavigateTabFunc
- type SetLayoutModelFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupPath ¶
CleanupPath normalizes a path, joining it with basePath if relative.
func WalkLayoutModel ¶
func WalkLayoutModel(m *s4wave_layout.LayoutModel, fn func(node any) bool)
WalkLayoutModel walks all nodes in a layout model, calling fn for each node. Returns early if fn returns false.
Types ¶
type AddTabFunc ¶
type AddTabFunc = func(ctx context.Context, req *s4wave_layout.AddTabRequest) (*s4wave_layout.AddTabResponse, error)
AddTabFunc is called when the frontend wants to add a new tab.
type LayoutResource ¶
type LayoutResource struct {
// contains filtered or unexported fields
}
LayoutResource wraps layout host functionality for resource access.
func NewLayoutResource ¶
func NewLayoutResource( stateCtr ccontainer.Watchable[*s4wave_layout.LayoutModel], setLayout SetLayoutModelFunc, navigateTab NavigateTabFunc, ) *LayoutResource
NewLayoutResource creates a new LayoutResource.
stateCtr is a watchable container for the layout model state. setLayout is called when the frontend updates the layout (may be nil). navigateTab is called when the frontend navigates within a tab (may be nil).
func (*LayoutResource) AddTab ¶
func (r *LayoutResource) AddTab(ctx context.Context, req *s4wave_layout.AddTabRequest) (*s4wave_layout.AddTabResponse, error)
AddTab adds a new tab to the layout.
func (*LayoutResource) GetMux ¶
func (r *LayoutResource) GetMux() srpc.Invoker
GetMux returns the rpc mux.
func (*LayoutResource) NavigateTab ¶
func (r *LayoutResource) NavigateTab(ctx context.Context, req *s4wave_layout.NavigateTabRequest) (*s4wave_layout.NavigateTabResponse, error)
NavigateTab navigates within a tab.
func (*LayoutResource) SetAddTabFunc ¶
func (r *LayoutResource) SetAddTabFunc(addTab AddTabFunc)
SetAddTabFunc sets the callback for adding tabs.
func (*LayoutResource) WatchLayoutModel ¶
func (r *LayoutResource) WatchLayoutModel(strm s4wave_layout.SRPCLayoutHost_WatchLayoutModelStream) error
WatchLayoutModel watches the LayoutModel.
type NavigateTabFunc ¶
type NavigateTabFunc = func(ctx context.Context, navigateTabReq *s4wave_layout.NavigateTabRequest) (*s4wave_layout.NavigateTabResponse, error)
NavigateTabFunc is called when the frontend wants to navigate within a tab.
type SetLayoutModelFunc ¶
type SetLayoutModelFunc = func(ctx context.Context, layoutModel *s4wave_layout.LayoutModel) error
SetLayoutModelFunc is called when the frontend wants to update the layout model.