resource_layout

package
v0.51.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupPath

func CleanupPath(basePath, targetPath string) string

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

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

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

NavigateTab navigates within a tab.

func (*LayoutResource) SetAddTabFunc

func (r *LayoutResource) SetAddTabFunc(addTab AddTabFunc)

SetAddTabFunc sets the callback for adding tabs.

func (*LayoutResource) WatchLayoutModel

WatchLayoutModel watches the LayoutModel.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL